Metadata-Version: 2.2
Name: sncl
Version: 1.0.1
Summary: A utility library for different API interactions
Home-page: https://github.com/sashanclrp/sncl-personal-libraries
Author: Sasha Nicolai Canal
Author-email: Sasha Nicolai Canal <sasha@candyflip.co>
License: MIT License
        
        Copyright (c) 2025 Sasha Nicolai Canal | Augmented Individual
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/sashanclrp/sncl-personal-libraries
Project-URL: Issues, https://github.com/sashanclrp/sncl-personal-libraries/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: pandas
Requires-Dist: typing
Dynamic: author
Dynamic: home-page
Dynamic: requires-python

# 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](https://airtable.com/developers/web/api/introduction).

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:

```bash
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:

```python
from sncl import airtable as at
```

### Example Usage

#### Fetching an Airtable Base Schema
```python
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
```python
table_ids = at.extract_table_ids(schema)
print(table_ids)
```

#### Fetching Records
```python
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
```python
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:

```python
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:

```bash
pip install requests pandas
```

---

## License

This library is licensed under the [MIT License](LICENSE).

---

For questions, feedback, or contributions, contact [Sasha Nicolai](mailto:sasha@candyflip.co).
