Skip to main content

Airtable to Neo4j data ingestor

Project description

air2neo

Test Lint and Deploy codecov

Airtable to Neo4j data ingestor

Quickstart

from air2neo import Air2Neo, MetatableConfig

a2n = Air2Neo(
    airtable_api_key,
    airtable_base_id,
    neo4j_uri,
    neo4j_username,
    neo4j_password,
    MetatableConfig(
        table_name,                         # "Metatable"
        # Optionally, you can provide `table`,
        # which is a pyairtable.Table object.

        name_col,                           # "Name",
        view_col,                           # "View", (optional)
        index_for_col,                      # "IndexFor",
        constrain_for_col,                  # "ConstrainFor",
        node_properties_col,                # "NodeProperties",
        edges_col,                          # "Edges",
        node_properties_last_ingested_col,  # "nodesLastIngested",
        edges_last_ingested_col,            # "edgesLastIngested",
        airtable_id_property_in_neo4j,      # "_aid" (The name of the property in Neo4j that stores the Airtable ID, defaults to)
        format_edge_col_name,               # "function that formats edge column names. Removes everything after a double-underscore, e.g. IN_INDUSTRY__BANK is renamed to IN_INDUSTRY",
        airtable_api_key,                   # "Airtable API key",
        airtable_base_id,                   # "Airtable base ID",
    ),
)
a2n.run()

If you have a .env file like so:

AIRTABLE_API_KEY=
AIRTABLE_BASE_ID=
AIRTABLE_METATABLE_NAME=        # Optional, defaults to "Metatable"
NEO4J_URI=
NEO4J_USERNAME=
NEO4J_PASSWORD=

You just run the following:

from air2neo import Air2Neo

a2n = Air2Neo()
a2n.run()

Installation

pip install air2neo

Or run it without installing:

uvx air2neo

Run the migration

Set the required environment variables, either in your shell or in a .env file:

AIRTABLE_API_KEY=
AIRTABLE_BASE_ID=
AIRTABLE_METATABLE_NAME=Metatable
NEO4J_URI=
NEO4J_USERNAME=
NEO4J_PASSWORD=

Run the migration directly with uvx:

uvx air2neo

CLI arguments override environment variables and .env values:

uvx air2neo \
  --airtable-api-key "$AIRTABLE_API_KEY" \
  --airtable-base-id "$AIRTABLE_BASE_ID" \
  --metatable-name "Metatable" \
  --neo4j-uri "$NEO4J_URI" \
  --neo4j-username "$NEO4J_USERNAME" \
  --neo4j-password "$NEO4J_PASSWORD"

Config priority is:

  1. CLI arguments
  2. Environment variables, including values loaded from .env
  3. Built-in default for AIRTABLE_METATABLE_NAME, which is Metatable

To use an explicit command name:

uvx --from air2neo air2neo-migrate

For local development:

uv sync --group dev
uv run air2neo

Release

uv version --bump patch
git add pyproject.toml uv.lock
git commit -m "Bump version to $(uv version --short)"
git push origin main

Pushing a bumped version to main publishes the package to PyPI after CI passes. The publish job checks PyPI first, so pushes that do not change the version are skipped.

You can also publish locally:

uv build --no-sources --sdist --wheel --out-dir dist/
uv publish dist/*

Documentation

To be implemented. For now, please look at the code docstrings. Sorry about that!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

air2neo-2.3.0.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

air2neo-2.3.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file air2neo-2.3.0.tar.gz.

File metadata

  • Download URL: air2neo-2.3.0.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for air2neo-2.3.0.tar.gz
Algorithm Hash digest
SHA256 66335ad3b4676416a09cd90da9cd50bfcb1c139a8b8bb1b35a8aa2ff51f403c4
MD5 821e6420e627cbf9e77de734d3e832a9
BLAKE2b-256 9bd06aec176160be1e10de301c84e322876573d99bc94298a11f8257ba86841e

See more details on using hashes here.

File details

Details for the file air2neo-2.3.0-py3-none-any.whl.

File metadata

  • Download URL: air2neo-2.3.0-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for air2neo-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a2e92ecc97754135cf8abc81d4ba93d5f4442c2df7204a2adaec4087717cd70
MD5 28b7b2e9472d1db7e64f43c0022359cd
BLAKE2b-256 7269d4db59e754f0caf323416a5474301d720e13aa6ab6b129f6a1bb87694bcc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page