> For the complete documentation index, see [llms.txt](https://www.csvpath.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.csvpath.org/getting-started/quickstart.md).

# Quickstart

This page gives you all the information you need to get started validating your CSVs with CsvPath Framework. It is super high-level and quick. You will want to go deeper on other pages later. We're going to do a trivial validation of a CSV file. Validating an Excel file would be essentially the same.

{% hint style="warning" %}
For an **even quicker start**, download the free **FlightPath Data** app from [Microsoft](https://apps.microsoft.com/detail/9P9PBPKZ4JDF) or [Apple](https://apps.apple.com/us/app/flightpath-data/id6745823097) or [Github](https://github.com/dk107dk/flightpath).&#x20;

FlightPath is the open source frontend to CsvPath Framework. It is your CSV/Excel file feed development and operations cockpit. When you open FlightPath you will see [these examples that you can immediately run](/getting-started/the-flightpath-data-examples.md).
{% endhint %}

{% hint style="info" %}
If you need help getting started with Python, try [Python.org's intros](https://www.python.org/about/gettingstarted/). Starting with a project tool like [Poetry](https://python-poetry.org/docs/basic-usage/) or [Jupyter Notebooks](https://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/) can also help.
{% endhint %}

{% hint style="success" %} <mark style="color:green;">Feel like skipping the Python?</mark> [Watch these videos](https://www.youtube.com/@atesta-analytics) <mark style="color:red;">🎥</mark> or [try this Python-free CLI example](/getting-started/more-csv-and-excel-validation/your-first-validation-the-lazy-way.md)**.**
{% endhint %}

### PyPI and Github

[The open source CsvPath Framework](https://github.com/csvpath/csvpath) is available through [PyPI](https://pypi.org/project/csvpath/) as `csvpath`. The project is quite active. You should pin the version you use but update it regularly.&#x20;

We use Poetry for our own development. If you choose Poetry, all you need to do is:&#x20;

```
poetry new <<your project name>>
cd <<your project name>>
poetry add csvpath
```

If you prefer Pip, install CsvPath Framework with:

```
pip install csvpath
```

Have a look at the [Github project](https://github.com/dk107dk/csvpath) for more details. You can read that site in parallel to this one.

<div data-full-width="false"><figure><img src="/files/O00xMlbOTyTrQPq0w8UG" alt="Screenshot of the open source CsvPath Framework&#x27;s GitHub page" width="375"><figcaption></figcaption></figure></div>

### Let's run something!

The worker class in CsvPath is unsurprisingly called `CsvPath`. For simple validation, it is all you need. &#x20;

{% hint style="warning" %}
For more complex situations and DataOps automation we use the manager class `CsvPaths`. But we'll come back to that in later pages. For now just know that it exists, has essentially the same API, and is equally lightweight to use.
{% endhint %}

The quickest way to bootstrap a CsvPath Framework project is the command line interface (CLI). The CLI is a super simple tool that is great for fast no-code development. To try the CLI, skip over to [Your First Validation, The Lazy Way](/getting-started/more-csv-and-excel-validation/your-first-validation-the-lazy-way.md).&#x20;

To continue with the simplest possible Python, let's do a *hello world*.&#x20;

Create a script file and import CsvPath:&#x20;

<figure><img src="/files/nGCcjqLscanDX2jk6NEx" alt="" width="375"><figcaption><p>Add CsvPath to your requirements.txt or dependency manger first, of course!</p></figcaption></figure>

```python
from csvpath import CsvPath
```

Create a test CSV file. Save it as trivial.csv or whatever name you like.

<figure><img src="/files/ACMNqbAuhMlcEGnITXzC" alt="A trivial CSV file to do a simple intro validation using CsvPath Language" width="359"><figcaption></figcaption></figure>

{% file src="/files/5tc23tVYmWUjAgKd01nx" %}

Make a csvpath. Also a trivial one, just to keep it simple.

<figure><img src="/files/FWe1jtn1RMETUqPSKrWB" alt="A trivial CsvPath Language validation statement. This statement can validate a CSV or Excel file." width="563"><figcaption></figcaption></figure>

```python
csvpath = """$trivial.csv[*][yes()]"""
```

This path says:&#x20;

* Open `trivial.csv`
* Scan all the lines
* Match every one of them

<figure><img src="/files/yjuWu3EnWkXTIm9WSaW1" alt="A screenshot of the Python to run the validation file. It is the same as the code below." width="563"><figcaption></figcaption></figure>

Here's everything:

{% code lineNumbers="true" %}

```python
from csvpath import CsvPath

path = """$trivial.csv[*][yes()]"""

cp = CsvPath()
cp.fast_forward(path)

if cp.is_valid:
    print("Totally valid!")
else:
    print("Not valid.")    
```

{% endcode %}

What does this script do?

* **Line 1:** imports CsvPath so we can use it
* **Line 3:** is our csvpath that we'll use to validate our test file, `trivial.csv`
* **Line 6:** fast-forwards though the CSV file's lines. We could also step through them one by one, if we wanted to.&#x20;
* **Line 8:** checks if we consider the file valid. If the file didn't meet expectations our csvpath would have declared the file invalid using the `fail()` function.&#x20;

When you run your script you should see something like:

<figure><img src="/files/FTFODMuT97alHhBNh7nT" alt="A screenshot of what you should see when you run your validation." width="324"><figcaption></figcaption></figure>

Hello-world examples are never super impressive on their own. But you are now ready to dig in and see what CsvPath can really do.&#x20;

Next, try [Your First Validation, the Lazy Way](/getting-started/more-csv-and-excel-validation/your-first-validation-the-lazy-way.md). Also check out the [How-tos section](/topics/how-tos.md) for more use cases and examples. If you'd like a helping hand, [contact us](/getting-started/a-helping-hand.md)!
