PyCyphORM 0.1.2__py3-none-any.whl → 0.1.2.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyCyphORM
3
- Version: 0.1.2
3
+ Version: 0.1.2.dev0
4
4
  Summary: A Minimalistic SQLite InMemory Encrypted ORM
5
5
  Author: jafrmartins
6
6
  Author-email: j.afr.martins@outlook.pt
@@ -0,0 +1,5 @@
1
+ PyCyphORM-0.1.2.dev0.dist-info/METADATA,sha256=j72FjtKlXrVirYN7Rc4MaplJl1nx-F43_8q8QIb7Yms,1135
2
+ PyCyphORM-0.1.2.dev0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
3
+ PyCyphORM-0.1.2.dev0.dist-info/entry_points.txt,sha256=6R4UorjfxYmbqjbF9d1fgmQybp5Zgy4Bw6PclOdO31Q,38
4
+ PyCyphORM-0.1.2.dev0.dist-info/top_level.txt,sha256=74rtVfumQlgAPzR5_2CgYN24MB0XARCg0t-gzk6gTrM,4
5
+ PyCyphORM-0.1.2.dev0.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- src/__init__.py,sha256=QL_yeVt2TuLjQoDbY8utuRUxvk_B-DGHbBM-tAf91dw,91
2
- src/cli.py,sha256=z5xOtyWibyx7RkCgOtAAxX_Rd5JATvH-VkNVRyN83S0,1394
3
- PyCyphORM-0.1.2.dist-info/METADATA,sha256=HPAqg6pGrCd5_P9PK2EYS3KSJDeWzfzBFEH8J7QnSis,1130
4
- PyCyphORM-0.1.2.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
5
- PyCyphORM-0.1.2.dist-info/entry_points.txt,sha256=6R4UorjfxYmbqjbF9d1fgmQybp5Zgy4Bw6PclOdO31Q,38
6
- PyCyphORM-0.1.2.dist-info/top_level.txt,sha256=74rtVfumQlgAPzR5_2CgYN24MB0XARCg0t-gzk6gTrM,4
7
- PyCyphORM-0.1.2.dist-info/RECORD,,
src/__init__.py DELETED
@@ -1,3 +0,0 @@
1
- from src.lib.adapter import load_config
2
- from src.lib.orm import ORM
3
- from src.cli import cli
src/cli.py DELETED
@@ -1,45 +0,0 @@
1
- #!/bin/env python3
2
-
3
- import argparse
4
-
5
- from os import urandom, path
6
- from base64 import b16encode
7
- import random
8
-
9
- import json
10
-
11
- def random_password():
12
- password = ""
13
- characters = "abcdefghijklmnopqrstuvxyz0123456789~/|#$%&()"
14
- for index in range(12):
15
- password = password + random.choice(characters)
16
- return password
17
-
18
- parser = argparse.ArgumentParser(
19
- prog = 'PyCyphORM',
20
- description = 'A Minimalistic SQLite InMemory Encrypted ORM',
21
- )
22
-
23
- parser.add_argument("-i", "--init", metavar="INIT", help="Initialize Salt and Password for Encrypted Database")
24
- parser.add_argument("-d", "--decrypt", metavar="FILEPATH", help="Descrypt SQLite Database")
25
- #parser.add_argument("output", metavar="DEST", default=".", help="Destination Folder")
26
-
27
- def cli():
28
- args = vars(parser.parse_args())
29
- if args["init"]:
30
- with open(".pyorm", "w") as f:
31
- f.write(json.dumps({
32
- "SALT": b16encode(urandom(16)).decode("utf-8"),
33
- "PASSWORD": b16encode(bytes(random_password(), "utf-8")).decode("utf-8")
34
- }))
35
-
36
- elif args['decrypt']:
37
- if path.exists(path.abspath(args['decrypt'])):
38
-
39
- from src.lib.adapter import decrypt_cdb, load_config
40
-
41
- cnf = load_config(".pyorm")
42
- decrypt_cdb(path.abspath(args['decrypt']), cnf["PASSWORD"], cnf["SALT"])
43
-
44
-
45
- if __name__ == "__main__": cli()