Skip to main content

Add your description here

Project description

ACMA ORM

ACMA ORM is a Python library designed to quickly import the AMCA specrta_rrl data dump into a termporary SQLite database and provide an intuitive Peewee ORM interface for querying records. This library is intended to be used locally for data analytics.

Features

  • Bulk CSV Import: Efficiently load ACMA CSV dumps into a SQLite database using Pandas
  • ORM Interface: Query your data using Peewee ORM. Examples provided below

Installation and Usage

pip install acma-orm

Download spectra_rrl and extract all files into path/to/spectra_rrl_directory (wherever you want, as long as Python can find it)

Once installed use like below:

from acma_orm.importer import import_all_data
from acma_orm.models import Licence, Client
from playhouse.shortcuts import model_to_dict

# Import your CSV dump (ensure your CSV files are in the specified folder)
import_all_data("path/to/spectra_rrl_directory")

# Query licences for a specific client.
query = (Licence
         .select(Licence)
         .join(Client)
         .where((Client.licencee == "TELSTRA LIMITED") &
                (Client.trading_name == "Telstra - Commerical Engineering - Spectrum Strategy")))
for licence in query:
    print(model_to_dict(licence, recurse=True))

Contributing

  1. Install UV:

    pip install uv
    
  2. Close the Repo and sync environment

    git clone https://github.com/jacksonbowe/acma-orm.git
    cd acma-orm
    
    uv sync
    
  3. Download spectra_rrl and extract all files into examples/spectral_rrl

  4. Run Example Scripts:
    The examples/ directory contains individual scripts that demonstrate various query types. For instance, run:

    uv run examples/init.py
    uv run examples/simple_query.py
    uv run examples/join_query.py
    uv run examples/aggregation_query.py
    uv run examples/complex_query.py
    

Project Structure

acma-orm/
├── pyproject.toml            # Build configuration for UV (and PyPI metadata)
├── README.md                # This file
├── LICENSE                  # License file (MIT License)
├── examples/                # Example scripts demonstrating package usage
│   ├── spectra_rrl/
│   │   ├── <put_spectra_rrl_data_in_here>
│   ├── init.py              # Run me first
│   ├── simple_query.py
│   ├── join_query.py
│   ├── aggregation_query.py
│   └── complex_query.py
├── src/
│   └── acma_orm/            # Package source code
│       ├── __init__.py      # Exposes package API (including enable_debug_logging)
│       ├── database.py      # Database connection and initialization logic
│       ├── importer.py      # Functions to import CSV data
│       └── models.py        # Peewee ORM model definitions

License

This project is licensed under the MIT License

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

acma_orm-0.1.9.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

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

acma_orm-0.1.9-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file acma_orm-0.1.9.tar.gz.

File metadata

  • Download URL: acma_orm-0.1.9.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.4

File hashes

Hashes for acma_orm-0.1.9.tar.gz
Algorithm Hash digest
SHA256 16b0f50451887b78eef5b96c1104a99317cf1670467b939ffc53a3233d5b8326
MD5 0fa990bc65347472575ba7969f93ab4d
BLAKE2b-256 6019ba83084e2557e299e626d6c6a3ce7e614775cc175f60328887297668efdf

See more details on using hashes here.

File details

Details for the file acma_orm-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: acma_orm-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.4

File hashes

Hashes for acma_orm-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 9a6081bf232d20fbbb5df9a3c762cb359dd9756e901ea18ce0eeece61bc1f9ef
MD5 d80245fae702c17cc8a8bb95e98808de
BLAKE2b-256 87b35698e959f91c31b354036597c92368ad90b240eb57fd37ce8423b2f0fa41

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