Skip to content

Instantly share code, notes, and snippets.

View maljukan's full-sized avatar
🏠
Working from home

Nenad Maljukan maljukan

🏠
Working from home
View GitHub Profile
@keithrozario
keithrozario / memory.py
Last active August 28, 2023 10:43
Read file from s3.download_fileobj into memory
s3 = boto3.client('s3')
## Reading a JSON file in memory
with tempfile.TemporaryFile() as data:
s3.download_fileobj(bucket_name, 'tests/s3/key.json', data)
data.seek(0)
status = json.loads(data.read().decode('utf-8'))['status']
## Reading a CSV file in memory
with tempfile.TemporaryFile() as package_file:
@rg3915
rg3915 / graph_models.md
Last active February 20, 2024 07:39
Generate graphic model Django with PyGraphViz pygraphviz pydot generate model graph model 2020

How to generate graphic model Django with PyGraphViz?

sudo apt-get install -y graphviz libgraphviz-dev pkg-config
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install pygraphviz
pip uninstall pyparsing
pip install -Iv https://pypi.python.org/packages/source/p/pyparsing/pyparsing-1.5.7.tar.gz#md5=9be0fcdcc595199c646ab317c1d9a709