Skip to content

Commit bcb7edf

Browse files
committed
camelcase changed to snakecase for methods & variables.readme updated
1 parent 552700a commit bcb7edf

File tree

10 files changed

+165
-334
lines changed

10 files changed

+165
-334
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<img src="https://img.shields.io/github/languages/top/Aviksaikat/swarm-cid-py?style=for-the-badge&color=DEDE17" alt="GitHub top language" />
3131
</div>
3232

33-
______________________________________________________________________
33+
---
3434

3535
## 📖 Table of Contents
3636

@@ -43,15 +43,15 @@ ______________________________________________________________________
4343
- [🤝 Contributing](#-contributing)
4444
- [📄 License](#-license)
4545

46-
______________________________________________________________________
46+
---
4747

4848
## 📍 Api
4949

5050
Utility library written in Python to convert Swarm hex references into Swarm CIDs.
5151

5252
The swarm-cid library provides the following functions:
5353

54-
`encodeReference(reference, type, version)`
54+
`encode_reference(reference, type, version)`
5555

5656
Encodes a reference string into a CID.
5757

@@ -60,7 +60,7 @@ Encodes a reference string into a CID.
6060
- version: The version of the CID (either 1 or 2).
6161
Returns a CID string.
6262

63-
`decodeCid(cid)`
63+
`decode_cid(cid)`
6464

6565
Decodes a CID string into a dictionary containing information about the underlying data.
6666

@@ -72,34 +72,34 @@ following keys:
7272
- reference: The reference string extracted from the CID.
7373
- type: The type of the reference (either ReferenceType.MANIFEST or ReferenceType.FEED).
7474

75-
`decodeFeedCid(cid)`
75+
`decode_feed_cid(cid)`
7676

7777
Decodes a CID string into a feed reference string.
7878

7979
- cid: The CID string to decode.
8080
Returns a feed reference string.
8181

82-
`decodeManifestCid(cid)`
82+
`decode_manifest_cid(cid)`
8383

8484
Decodes a CID string into a manifest reference string.
8585

8686
- cid: The CID string to decode.
8787
Returns a manifest reference string.
8888

89-
`encodeFeedReference(reference)`
89+
`encode_feed_reference(reference)`
9090

9191
Encodes a feed reference string into a CID.
9292

9393
- reference: The feed reference string to encode.
9494
Returns a CID string.
9595

96-
`encodeManifestReference(reference)`
96+
`encode_manifest_reference(reference)`
9797

9898
Encodes a manifest reference string into a CID.
9999

100100
- reference: The manifest reference string to encode.
101101

102-
______________________________________________________________________
102+
---
103103

104104
## 🚀 Getting Started
105105

@@ -109,39 +109,39 @@ ______________________________________________________________________
109109
py-multiformats-cid
110110
```
111111

112-
______________________________________________________________________
112+
---
113113

114114
### 🔧 Installation
115115

116116
```sh
117117
pip install swarm_cid_py
118118
```
119119

120-
______________________________________________________________________
120+
---
121121

122122
### 🤖 Running swarm-cid-py
123123

124124
```py
125-
>>> from swarm_cid import encodeReference, decodeCid
125+
>>> from swarm_cid import encode_reference, decode_cid
126126
>>> reference = "4c949794d617238d928ef1dc544ee07cbdcfd6b946e5202fa06c4d32088d7e69"
127-
>>> cid = encodeReference(reference, ReferenceType.MANIFEST, 1)
127+
>>> cid = encode_reference(reference, ReferenceType.MANIFEST, 1)
128128
>>> print(str(cid))
129129
bah5acgzajskjpfgwc4ry3euo6hofitxaps647vvzi3ssal5anrgtecenpzuq
130-
>>> decoded_cid = decodeCid(cid)
130+
>>> decoded_cid = decode_cid(cid)
131131
>>> print(decoded_cid.to_dict())
132132
{'reference':
133133
'4c949794d617238d928ef1dc544ee07cbdcfd6b946e5202fa06c4d32088d7e69', 'type': 'manifest'}
134134
```
135135

136-
______________________________________________________________________
136+
---
137137

138138
### 🧪 Tests
139139

140140
```sh
141141
pytest tests/test_swarm_cid.py
142142
```
143143

144-
______________________________________________________________________
144+
---
145145

146146
## 🤝 Contributing
147147

@@ -180,12 +180,12 @@ Once your PR is reviewed and approved, it will be merged into the main branch.
180180

181181
</details>
182182

183-
______________________________________________________________________
183+
---
184184

185185
## 📄 License
186186

187187
This project is protected under the [BSD-3-Clause](./LICENSE) License.
188188

189189
[**Return**](#Top)
190190

191-
______________________________________________________________________
191+
---

poetry.lock

Lines changed: 78 additions & 78 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
[tool.poetry]
22
name = "swarm-cid-py"
3-
version = "0.1.0"
3+
version = "0.1.2"
44
description = "Utility library written in Python to convert Swarm hex references into Swarm CIDs"
55
authors = ["SAIKAT KARMAKAR <saikickkarma@protonmail.com>"]
66
readme = "README.md"
7+
license = "AGPL-3.0-or-later"
78
packages = [{ include = "swarm_cid", from = "src" }]
9+
homepage = "https://github.com/Aviksaikat/swarm-cid-py"
810

911
[tool.poetry.dependencies]
1012
python = "^3.9"
1113
py-multiformats-cid = "^0.4.4"
1214
multiformats-fix = "^0.2.2"
13-
pysha3 = "^1.0.2"
15+
safe-pysha3 = "^1.0.4"
1416

1517
[tool.poetry.group.lint.dependencies]
1618
black = "^23.11.0"
@@ -28,6 +30,7 @@ mdformat = "^0.7.17"
2830
mdformat-gfm = "^0.3.5"
2931
mdformat-frontmatter = "^0.4.1"
3032
mdformat-pyproject = "^0.0.1"
33+
flake8-pyproject = "^1.2.3"
3134

3235
[tool.poetry.group.dev.dependencies]
3336
pytest = "^7.4.3"
@@ -67,7 +70,12 @@ number = true
6770
module = "eth_keys.*"
6871
ignore_missing_imports = true
6972

70-
# * not working so defined in setup.cfg
71-
# [tool.flake8]
72-
# line-length = 100
73-
# exclude = ["__pycache__", ".venv/*"]
73+
# flake8
74+
[tool.flake8]
75+
max-line-length = 100
76+
ignore = ["E203", "W503"]
77+
exclude = ["__pycache__", ".venv/*", "docs/*"]
78+
docstring-convention = "google"
79+
80+
[tool.mypy]
81+
ignore_missing_imports = true

requirements.txt

Lines changed: 0 additions & 66 deletions
This file was deleted.

setup.cfg

Lines changed: 0 additions & 58 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)