Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Aitronos Python Package

A Python package for interacting with the Freddy API and other Aitronos services. This package provides a command-line interface (CLI) for managing Aitronos projects and services.

Installation

pip install aitronos

CLI Commands

The aitronos CLI provides several commands for project initialization:

Basic Project Initialization

aitronos init <project_name>

Creates a new project with the standard Aitronos project structure:

  • src/ - Source code directory
  • resources/ - Project resources
  • config.freddy.json - Configuration file
  • requirements.txt - Python dependencies
  • documentation.txt - Project documentation
  • execution_log.json - Execution logs

Hello World Example Project

aitronos init-hello-world <project_name>

Creates a basic Hello World example project that includes:

  • Basic project structure
  • Simple Click-based CLI example in src/main.py
  • Pre-configured requirements.txt with Click dependency
  • Example README.md with usage instructions

Hello World with Parameters Example

aitronos init-hello-world-params <project_name>

Creates an advanced Hello World example that demonstrates CLI parameter handling:

  • Complete project structure
  • Advanced Click-based CLI example with parameter handling
  • Example of using command-line options and arguments
  • Detailed README.md with usage examples

Interactive Hello World Command

aitronos hello [OPTIONS]

A simple interactive command to demonstrate CLI parameter handling.

Options:

  • --name, -n TEXT: Name to greet (default: "World")
  • --count, -c INTEGER: Number of times to greet (default: 1)

Example usage:

# Basic usage
aitronos hello

# Custom name
aitronos hello --name Alice

# Multiple greetings
aitronos hello --name Bob --count 3

Development

To set up the development environment:

  1. Clone the repository:
git clone https://github.com/Freddy-Development/aitronos-python-package.git
cd aitronos-python-package
  1. Install development dependencies:
pip install -e ".[dev]"
  1. Run tests:
pytest

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

Support

For support, please open an issue on the GitHub repository or contact the development team.

Library Usage

from Aitronos import Aitronos, Message, MessageRequestPayload

# Enable staging mode (uses aitronos.ch instead of aitronos.com)
Aitronos.set_staging_mode(True)  # Call this before creating any client instances

# Initialize with API key (recommended)
client = Aitronos(api_key="your_api_key")

# Or with username/password
client = Aitronos(username="your_username", password="your_password")

# Use the assistant messaging
messaging = client.assistant_messaging
response = messaging.execute_run(
    MessageRequestPayload(
        organization_id=123,
        assistant_id=456,
        messages=[Message(content="Hello!", role="user")]
    )
)

Environment Configuration

The Aitronos package supports different environments through staging mode:

  • Production (default): Uses aitronos.com domain
  • Staging: Uses aitronos.ch domain

You can switch to staging mode in two ways:

  1. Globally before creating any clients:
from Aitronos import Aitronos

# Enable staging mode
Aitronos.set_staging_mode(True)

# All subsequent client instances will use staging environment
client = Aitronos(api_key="your_api_key")
  1. Disable staging mode:
# Switch back to production
Aitronos.set_staging_mode(False)

Note: Staging mode must be set before creating any client instances, as it affects the base URL used for all API calls.

Command Line Interface (CLI)

The Aitronos package includes a powerful CLI for common operations and project management.

Configuration

Before using the CLI, set up your configuration:

  1. Create a config.json file in your project root:
{
    "test_key": "your_api_key",
    "test_org_id": your_organization_id,
    "test_assistant_id": your_assistant_id,
    "test_username": "your_username",
    "test_password": "your_password"
}
  1. Add config.json to your .gitignore to keep credentials secure:
echo "config.json" >> .gitignore

Available Commands

  1. Initialize a new project:
aitronos init my_project

This creates a new project with the following structure:

my_project/
├── config.freddy.json
├── documentation.txt
├── execution_log.json
├── requirements.txt
├── resources/
│   ├── __init__.py
│   ├── current_user.py
│   ├── helpers.py
│   ├── org_data.json
│   └── user_data.json
└── src/
    ├── main/
    │   └── my_project.py
    └── tests/
        └── test_script.py
  1. Run the hello world example:
aitronos hello

Tests your setup with a simple hello world example using the Aitronos API.

  1. Use StreamLine functionality:
# Interactive mode
aitronos streamline

# Process a file
aitronos streamline --input input.txt --output output.txt

Project Templates

When initializing a new project with aitronos init, you get:

  • Basic project structure
  • Configuration files
  • Example code
  • Resource templates
  • Test setup

The generated project includes:

  • Logging setup
  • Error handling
  • User management
  • API integration
  • Basic test structure

Development Workflow

  1. Initialize a new project:
aitronos init my_aitronos_project
cd my_aitronos_project
  1. Update the configuration:
# Edit config.json with your credentials
vim config.json
  1. Install project dependencies:
pip install -r requirements.txt
  1. Start developing:
# Your main code is in src/main/my_aitronos_project.py
# Tests are in src/tests/

Development

To contribute or modify the package:

  1. Clone the repository:
git clone https://github.com/Freddy-Development/aitronos-python-package.git
cd aitronos-python-package
  1. Install development dependencies:
pip install -e ".[dev]"
  1. Run tests:
python -m unittest discover tests

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support, please:

Security

To report security vulnerabilities, please email security@aitronos.com

Metadata

Release files for aitronos 4.5.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aitronos 4.5.7
File Size Uploaded
aitronos-4.5.7.tar.gz 35.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aitronos 4.5.7
File Interpreter ABI Platform
aitronos-4.5.7-py3-none-any.whl Python 3 none any Details

Total release size: 82.8 kB

Release files / aitronos-4.5.7.tar.gz

Download URL aitronos-4.5.7.tar.gz
Size 35.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fb800e7b67e97fe9a60b4c2e64144b09f76789c3bc95f2c4448814749236866c
BLAKE2b-256 checksum
How to use checksums
88caf84d8abd429d82effdd2608afd3a408e89d383662ad7e8ef38022564c196
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.5

Release files / aitronos-4.5.7-py3-none-any.whl

Download URL aitronos-4.5.7-py3-none-any.whl
Size 47.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70b97c24738e3eeb061c0e6b3d1f356ce3879da3d31bcf4385f91dbbab0afca3
BLAKE2b-256 checksum
How to use checksums
968dff3b1e49ea8075c8388938bf05590c639e50d382224ef1caa60faa383384
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.5
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page