Skip to main content

build status

file-flamingo

A suite of base classes that simplifies interactions with files.

pip3 install fileflamingo
from fileflamingo.BaseFile import BaseFile
from fileflamingo.RSAFile import RSAFile
from fileflamingo.EncryptionFile import EncryptionFile

base_file = BaseFile("./my_text.txt")
base_file.create_filepath()
base_file.append_data_to_file("I am about to be encrypted.")

rsa_file = RSAFile('./my_key.pem')
rsa_file.gen_pem_file() # Creates an rsa key and writes it to my_key.pem.

encryption_file = EncryptionFile(base_file.get_filepath(), rsa_file.get_filepath())

encryption_file.encrypt() # Encrypt ./my_text.txt with the encrypt function.
print(my_file.get_bytes_from_file())

encryption_file.decrypt() # It can be decrypted with the decrypt() function.
print(my_file.get_contents_of_file())

Output:

b'\x8cZc\x1bA*\xbb\x00\xc5\x1a\x0e)\x8d\x1f\x05+\xa0\x81\xda\xb9\x91\n\n\x17J p\xb0\x0f>\xf3)\xf9*\xda\x97J\x1b\x94\x11Q\xe7\xdd\x84\x1c\x1ca9)\xdcY\x0e\x95\x11\xbf=\xfb8\x88\x88f\xc1\xf2\xfeV\\\x8d\\~]\xef\t\xac\x8b\xa0+\xf5W\xf5\xea\x04\tU\xe2[\xd6v\xad\x08Z\xd7\x82\x08\x07\xd2\x8bS\xc4\xbe\xc2e\x96\x7fk\xe8\xb5S\xa4\x95;\x12Y\x83\x11\xbe\xa6\x82!\xf4\x18\xef\xf1\xce\xdd\x934Ay\x08\xd9\xfa\t.\x00b\xdfvY( \x8a\xed\xdc\xd8\xeb\x12\xf2\xf0\xa6G\x08T#\x91p\xb2<\xe6\xf9\x94)J\xe2le\x13\x02\x92s\xbb\xbd\xc8\xebI\xb4\x041\xa0\x9d\xbfy?\xe3\xe4\xa7\x98\x07pX\x87\xda\xd9\xba\xd5c3\rWBv0\x17\xf7\xff}\x1d\x83\xf5\xc6)\xdd||\xe8\xd0\x90^$\xae\xbb\xf7Kc\x15.\xd8\xa8F\x16\xee\xb5\x00z<\xd88\x05Z,\xef\xc0\xe1\xbe\xfdY\xb0\xa5\x1aX\xa3R"o\xf2\x9c\xbe'
I am about to be encrypted.

BaseFile

BaseFile(filepath)

Functions:

  • get_contents_of_file (only works with text)
  • create_filepath (either a file or a dir)
  • delete_file (only works on files, not dirs)
  • append_data_to_file
  • write_data_to_file
  • clear_file
  • is_binary
  • is_empty
  • is_dir
  • is_file
  • filepath_exists

EncryptionFile

EncryptionFile(filepath, rsa_filepath)

Functions:

  • encrypt
  • decrypt
  • write_bytes_to_file
  • get_bytes_from_file

RSAFile

RSAFile(filepath)

Functions:

  • gen_key
  • gen_pem_file
  • get_key

Metadata

Release files for fileflamingo 0.0.6

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

Source distribution (sdist)

Source distribution for fileflamingo 0.0.6
File Size Uploaded
fileflamingo-0.0.6.tar.gz 5.2 kB Details

Built distribution (wheel)

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

Total release size: 11.8 kB

Release files / fileflamingo-0.0.6.tar.gz

Download URL fileflamingo-0.0.6.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
88cc9e5e1b4e5cd9ad3389e01cf9466d66b11b22c52eab5c61b4c3eda1ced24a
BLAKE2b-256 checksum
How to use checksums
9b858ec5f293d353916191375b4fdaaf839257c19e870c75b2c7c8ee942a5a33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release files / fileflamingo-0.0.6-py3-none-any.whl

Download URL fileflamingo-0.0.6-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bf24a91ea79fb5c1625e1f6379c06de43e46bfdf65e4056fa69b27f3ceaeb8f
BLAKE2b-256 checksum
How to use checksums
439db0eb2f12ea60af60c6ba31c68666a37c4d3d4d3b4d7f67ec965d6bc0e71b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release history Release notifications | RSS feed

0.0.7

2 release files

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.3

2 release files

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