Skip to main content

Treat your data as your code

Project description

Crazy Imports - treat your data as your code

CI Code style: black PyPI PyPI - Python Version PyPI - Implementation PyPI - License

crazyimports module allows you to use your data files as if it was python modules

Installation

pip install crazyimports

Simple example

Create example.json file with this content

{"number": 42}

Than in the same directory create test.py file

import crazyimports.json
import example

print(example.number)

Then when you run python test.py you would see 42 output in your command line

This and other examples you can find in examples/ folder

Supported file extensions

  • .json for JSON files
  • .sqlite3 for SQLite3 database files
  • .csv for CSV (Comma Separated Values) files
  • .yaml for YAML files

Inspiration

Heavily inspired by this talk by @bobuk

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

crazyimports-0.0.3.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

crazyimports-0.0.3-py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 3

Supported by

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