Skip to main content

A folder of functions and classes that are easy to import

Project description

important

🎁 Import Ant 🐜 The folder of python functions and classes we can import

PyPI version test pypi build

import ant avatar

📦 Installation

Import Ant is meant to be as light weight as possible, say you want to import some re-useable code for redis, but you don't want to install every dependency for kafka, snowflake, etc. You can install just the redis part with out worring to manage the distribution about anything else.

Very simple version

pip install import-a

With other distributions

pip install "import-a[redis]"

or

pip install "import-a[kafka,redis]"
pip install "import-a[kafka,snowflake]"

or just get greedy and install everything, with a specified version 🚀🏎💣🔪🔫🔨🧨🧱🧲🧪🧬🧯🧰

pip install "import-a[all]==0.0.1"

🔌 Connectors

❄️ Snowflake

from important.snowflake import SnowFlakeDatabricks
sf = SnowFlakeDatabricks.from_config()

# read data into a pandas dataframe
df = sf("SELECT * FROM some_table")

🍄 Redis

from important.redis import Redis, RedisAsync, RedisController

Vanilla Redis

# connect to redis
redis_client = Redis(host="localhost", db=0)

control = RedisController.from_task(redis_client, task="channel_pop")

# save data by key
control[dict(channel_id=137, user_id=424242)] = "Some string data"

Async Redis

redis_client = RedisAsync(host="localhost", db=0)

control = RedisControllerAsync.from_task(
    redis_client, task="channel_pop")

# save data by key, sadly the await expression doesn't support the [] syntax
await control.set(dict(channel_id=137, user_id=424242), "Some string data")

# get data by key
await control[dict(channel_id=137, user_id=424242)]

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

import-a-0.0.14.tar.gz (71.6 kB view details)

Uploaded Source

Built Distribution

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

import_a-0.0.14-py3-none-any.whl (68.1 kB view details)

Uploaded Python 3

File details

Details for the file import-a-0.0.14.tar.gz.

File metadata

  • Download URL: import-a-0.0.14.tar.gz
  • Upload date:
  • Size: 71.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for import-a-0.0.14.tar.gz
Algorithm Hash digest
SHA256 7437b9035a43ffb567c766d5d15d183a648e9e98f8d349bdb3a13e56554b0e36
MD5 7fa7760b1acc8ac90798a61f6c50bf97
BLAKE2b-256 0f9c95b128f13d24f04bf68252cb1b760f5e7d6427969d439817597386c249e8

See more details on using hashes here.

File details

Details for the file import_a-0.0.14-py3-none-any.whl.

File metadata

  • Download URL: import_a-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 68.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for import_a-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 38f4b9cfc5888c94b731793106d95a000b925217815d32c5a5a56b1d6a611833
MD5 b0af008b0c93e5f0d9a63740fa5c808c
BLAKE2b-256 a5f2e0c72c3bc7645396f908dc600e109306094f4bf257c6e6fe634b32c514f3

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