Skip to main content

A utility library for different API interactions

Project description

SNCL - Sasha Nicolai's Library

SNCL is a Python library designed to host several API integrations and utility functions. Currently, it provides support for Airtable API interactions, with plans to expand to other APIs in the future.


Current APIs

Airtable

The library currently supports operations for Airtable API. For detailed documentation on the Airtable API itself, visit: Airtable API Documentation.

Supported Airtable operations include:

  • Fetching base schemas
  • Extracting table IDs
  • Creating fields in Airtable tables
  • Fetching and filtering records
  • Creating, updating, and deleting records
  • Uploading attachments to Airtable fields
  • Managing Airtable fields and configurations

Future Plans

  • Add integrations for additional APIs (Notion, WhatsApp, Gmail).
  • Expand utility functions for data processing and manipulation.
  • Provide improved error handling and logging for all operations.

Installation

Pip Install

Install the library directly using pip:

pip install sncl

This will make the library available for use across your projects.


Usage

To start using the sncl library, you can import its modules like this:

from sncl import airtable as at

Example Usage

Fetching an Airtable Base Schema

base_id = "your_airtable_base_id"
airtable_token = "your_airtable_token"

schema = at.get_schema(base_id, airtable_token)
print(schema)

Extracting Table IDs from a Schema

table_ids = at.extract_table_ids(schema)
print(table_ids)

Fetching Records

base_id = "your_airtable_base_id"
table_id = "your_table_id"
airtable_token = "your_airtable_token"

records = at.fetch_airtable_records(base_id, table_id, airtable_token)
print(records)

Creating a Field in Airtable

base_id = "your_airtable_base_id"
table_id = "your_table_id"
api_key = "your_airtable_api_key"

fields = [
    {
        "name": "New Field",
        "type": "singleLineText",
        "description": "This is a new field for testing."
    }
]

at.create_airtable_fields(base_id, table_id, api_key, fields)

Getting Help

To get help on any function in the sncl.airtable module, you can use the Python help() function. For example:

help(at.get_schema)

This will display the function's docstring, including its purpose, arguments, and return values.


Dependencies

The following libraries are required to use sncl:

  • requests: For making HTTP requests to the Airtable API.
  • pandas: For processing and managing Airtable records as DataFrames.

You can install these dependencies using:

pip install requests pandas

License

This library is licensed under the MIT License.


For questions, feedback, or contributions, contact Sasha Nicolai.

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

sncl-1.0.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

sncl-1.0.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file sncl-1.0.1.tar.gz.

File metadata

  • Download URL: sncl-1.0.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.13

File hashes

Hashes for sncl-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2d92a6e743c5b4c40248f8e6b7bd3fe42658f4a4da55678d04af699d7946cb43
MD5 b1f5d58d285916ca8e3e2fc0b41e01c3
BLAKE2b-256 dc27f83c6e78452d99ed1aea5d1478e9c1b972204c0bfd7b5167c1743b84fcea

See more details on using hashes here.

File details

Details for the file sncl-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: sncl-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.13

File hashes

Hashes for sncl-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 74696cf7da9c04df5ab6ed4d838c2d25e631de42df990445e94fb407e475491a
MD5 1198e4a6afd900bbd8126a5f9b34407f
BLAKE2b-256 fe760dc8958be3aaf6e292d7a295672dd1d81bca14b7bb12dea56d471e6ad67d

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