Skip to content

Commit 6af5915

Browse files
committed
Rename module due to pypi name conflict
1 parent fc52f83 commit 6af5915

File tree

7 files changed

+43
-26
lines changed

7 files changed

+43
-26
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ current_version = 1.0.0
33

44
[bumpversion:file:setup.py]
55

6-
[bumpversion:file:pyconfig/__init__.py]
6+
[bumpversion:file:pyconfigstore/__init__.py]
77

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ A Python module for handling config files. It helps handles persist config files
44

55
> Easily load and persist config without having to think about where and how
66
7-
It's built base on nodejs [configstore](https:#github.com/yeoman/configstore)
7+
It's built base on nodejs [configstore](https://github.com/yeoman/configstore)
88

99
Config is stored in a JSON file located in `$XDG_CONFIG_HOME` or `~/.localconfig`.<br>
1010
Example: `~/.localconfig/configstore/name.json`
1111

1212
## Installation
1313

1414
```bash
15-
pip install pyconfig
15+
pip install pyconfigstore
1616
```
1717

1818
## Usage
1919

2020
```python
21-
from pyconfig import ConfigStore
21+
from pyconfigstore import ConfigStore
2222

2323
# create a Configstore instance with a unique name e.g. gnit
2424
# Package name and optionally some default values

docs/README.md

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,57 +12,59 @@ Example: `~/.localconfig/configstore/name.json`
1212
## Installation
1313

1414
```bash
15-
pip install pyconfig
15+
pip install pyconfigstore
1616
```
1717

1818
## Usage
1919

2020
```python
21-
from pyconfig import ConfigStore
21+
from pyconfigstore import ConfigStore
2222

23-
// create a Configstore instance with a unique name e.g. gnit
24-
// Package name and optionally some default values
23+
# create a Configstore instance with a unique name e.g. gnit
24+
# Package name and optionally some default values
2525
conf = ConfigStore("Gnit", {"foo": 'bar'});
2626

2727
print(conf.get('foo'));
28-
//>>> 'bar'
28+
#>>> 'bar'
2929

3030
conf.set('awesome', True);
3131
print(conf.get('awesome'));
32-
//>>> True
32+
#>>> True
3333

34-
// Use dot-notation to set nested properties
34+
# Use dot-notation to set nested properties
3535
conf.set('bar.baz', True);
3636
print(conf.get('bar'));
37-
//>>> {"baz": True}
37+
#>>> {"baz": True}
38+
39+
# escape dot-notation to set nested properties
40+
conf.set('bar.baz\\.bag', True);
41+
print(conf.get('bar'));
42+
#>>> {"baz.bag": True}
3843

3944
conf.delete('awesome');
4045
print(conf.get('awesome'));
41-
//>>>
46+
#>>>
4247
```
4348

44-
4549
## API
4650

47-
### Configstore(packageName, [defaults], [options])
51+
### Configstore(packageName, [defaults], globalConfigPath)
4852

4953
Returns a new instance.
5054

5155
#### packageName
5256

53-
Type: `string`
57+
Type: `str`
5458

5559
Name of your package.
5660

5761
#### defaults
5862

59-
Type: `Object`
63+
Type: `dicts`
6064

6165
Default config.
6266

63-
#### options
64-
65-
##### globalConfigPath
67+
#### globalConfigPath
6668

6769
Type: `bool`<br>
6870
Default: `False`
@@ -77,7 +79,7 @@ You can use dot-notation to set, get, update and delete nested dict properties
7779

7880
Set an item.
7981

80-
### .set(object)
82+
### .set(dict)
8183

8284
Set multiple items at once.
8385

@@ -97,9 +99,9 @@ Delete an item.
9799

98100
Delete all items.
99101

100-
### .all
102+
### .all()
101103

102-
Get all the config as an object or replace the current config with an object:
104+
Get all the config as a dict or replace the current config with an object:
103105

104106
```python
105107
conf.all({
@@ -115,8 +117,23 @@ Get the item count.
115117

116118
Get the path to the config file. Can be used to show the user where the config file is located or even better open it for them.
117119

120+
## Contribute
121+
122+
Yes, you can contribute. Just dm on twitter:[@OyetokeT](http://twitter.com/@OyetokeT)
123+
124+
## TODO
125+
126+
There are couple of things I still need to add
127+
128+
1. Dot-notation: Currently, you can only set configs using this feature. (get, delete)
129+
130+
2. Stream: I planned to add a param that'll indicate that you want it to hit the file for every operation. Well that's how it works currently though. But to make it smarter, we don't need to hit the file for (size, get, has, all) operation. We are going to call the `.all()` once to get the configs in dicts and do the operation just using dict properties.
131+
132+
and more...
118133

119134
## License
120135
Copyright - 2018
121-
Oyetoke Toby <twitter:@OyetokeT>
136+
137+
Oyetoke Toby twitter:[@OyetokeT](http://twitter.com/@OyetokeT)
138+
122139
MIT LICENSE

example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pyconfig import ConfigStore
1+
from pyconfigstore import ConfigStore
22

33
conf = ConfigStore("vestub", {"url":"http://vestub.com"}, True)
44
print(conf.get("url"))
File renamed without changes.
File renamed without changes.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def read(filename):
1313
long_description = read('README.md')
1414

1515
setup(
16-
name='pyconfig',
16+
name='pyconfigstore',
1717
version='1.0.0',
1818
description=(
1919
'A Python module for handling config files. It helps handles persist config files and also giving the ability to set, get, update and delete config settings'

0 commit comments

Comments
 (0)