localstore


Namelocalstore JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://github.com/colddsam/LocalStore.git
SummaryLocalStore is a Python library that provides various operations on a local database of products, which can be used to store and manage information about items in a local store inventory and it also give mobility to create an local API for the database. Besides this it can convert CSV file to json.
upload_time2024-01-27 13:21:41
maintainer
docs_urlNone
authorcolddsam
requires_python>=3.10,<4.0
licenseMIT
keywords data conversion dataset creation csv file processing json serialization directory traversal file reading data cleaning hashing data structure manipulation exception handling file writing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # localstore

The `localstore` package is a collection of Python modules for managing data in a local store. It includes modules for converting CSV files to a JSON dataset, managing data in a local JSON store, and creating a local API for accessing data in the store.

## Installation

To install the `localstore` package, you can use pip:

```
pip install localstore
```

## Usage

### DatasetConverter

The `DatasetConverter` module provides a simple and intuitive API for converting CSV files to a JSON dataset. To use the `DatasetConverter` module, you can:

1. Import the `DatasetConverter` module:

```python
from localstore.DatasetConverter import Converter
```

2. Create an instance of the `Converter` class:

```python
converter = Converter()
```

3. Convert all the CSV files in a specified directory to a JSON dataset:

```python
converter.Dataset_From_Directory('path/to/directory')
```

4. Convert a single CSV file to a JSON dataset:

```python
converter.Dataset_From_File('path/to/file.csv')
```

5. Create a JSON dataset file and a text file containing the length of the dataset:

```python
converter.Create_Dataset()
```

### LocalStore

The `LocalStore` module provides a simple and intuitive API for managing data in a local JSON store. To use the `LocalStore` module, you can:

1. Import the `LocalStore` module:

```python
from localstore.LocalStore import LocalStore
```

2. Create an instance of the `LocalStore` class:

```python
local_store = LocalStore()
```

3. Add a new product to the local store:

```python
product = {
    'name': 'iPhone 13 Pro',
    'main_category': 'Electronics',
    'sub_category': 'Smartphones',
    'image': 'https://example.com/iphone-13-pro.jpg',
    'link': 'https://example.com/iphone-13-pro',
    'ratings': '4.5',
    'no_of_ratings': '100',
    'discount_price': '999.00',
    'actual_price': '1099.00'
}
local_store.Add_New_Product(product_name='Apple', data=product)
```

4. Get a list of all the products in the local store:

```python
products = local_store.Show_product_List()
```

5. Print the list of products:

```python
for product in products:
    print(product)
```

### LocalAPI

The `LocalAPI` module provides a simple and intuitive API for creating a local API for accessing data in the store. To use the `LocalAPI` module, you can:

1. Import the `LocalAPI` module:

```python
from localstore.LocalAPI import LocalAPI
```

2. Create an instance of the `LocalAPI` class:

```python
local_api = LocalAPI()
```

3. Start the LocalAPI server:

```python
local_api.runServer()
```

4. Send API requests to the LocalAPI server to perform CRUD operations on data in the local store:

```python
import requests

# Get a list of all the products in the local store
products = requests.get('http://localhost:5000/products/show/')

# Print the list of products
for product in products.json():
    print(product)
```

## Conclusion

The `localstore` package is a powerful and easy-to-use Python package for managing data in a local store. It is a great choice for a variety of applications, including e-commerce websites, content management systems, data analysis applications, and any other application that needs to store data locally. 

## Contributing

Contributions to LocalStore are welcome! Please read the [contributing guidelines](https://github.com/colddsam/LocalStore/blob/main/CONTRIBUTING.md) before submitting a pull request.

## License

LocalStore is licensed under the [MIT License](https://github.com/colddsam/LocalStore/blob/b21bdae42f8a31a7ca5e9d954dace06d66c132f6/LICENSE)
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/colddsam/LocalStore.git",
    "name": "localstore",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10,<4.0",
    "maintainer_email": "",
    "keywords": "Data Conversion,Dataset Creation,CSV File Processing,JSON Serialization,Directory Traversal,File Reading,Data Cleaning,Hashing,Data Structure Manipulation,Exception Handling,File Writing",
    "author": "colddsam",
    "author_email": "dassamratkumar772@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/3c/be/49282773a803f7c8af8cad14e446ff3d0ba7d143223a8d4a19e738603c7f/localstore-0.2.1.tar.gz",
    "platform": null,
    "description": "# localstore\n\nThe `localstore` package is a collection of Python modules for managing data in a local store. It includes modules for converting CSV files to a JSON dataset, managing data in a local JSON store, and creating a local API for accessing data in the store.\n\n## Installation\n\nTo install the `localstore` package, you can use pip:\n\n```\npip install localstore\n```\n\n## Usage\n\n### DatasetConverter\n\nThe `DatasetConverter` module provides a simple and intuitive API for converting CSV files to a JSON dataset. To use the `DatasetConverter` module, you can:\n\n1. Import the `DatasetConverter` module:\n\n```python\nfrom localstore.DatasetConverter import Converter\n```\n\n2. Create an instance of the `Converter` class:\n\n```python\nconverter = Converter()\n```\n\n3. Convert all the CSV files in a specified directory to a JSON dataset:\n\n```python\nconverter.Dataset_From_Directory('path/to/directory')\n```\n\n4. Convert a single CSV file to a JSON dataset:\n\n```python\nconverter.Dataset_From_File('path/to/file.csv')\n```\n\n5. Create a JSON dataset file and a text file containing the length of the dataset:\n\n```python\nconverter.Create_Dataset()\n```\n\n### LocalStore\n\nThe `LocalStore` module provides a simple and intuitive API for managing data in a local JSON store. To use the `LocalStore` module, you can:\n\n1. Import the `LocalStore` module:\n\n```python\nfrom localstore.LocalStore import LocalStore\n```\n\n2. Create an instance of the `LocalStore` class:\n\n```python\nlocal_store = LocalStore()\n```\n\n3. Add a new product to the local store:\n\n```python\nproduct = {\n    'name': 'iPhone 13 Pro',\n    'main_category': 'Electronics',\n    'sub_category': 'Smartphones',\n    'image': 'https://example.com/iphone-13-pro.jpg',\n    'link': 'https://example.com/iphone-13-pro',\n    'ratings': '4.5',\n    'no_of_ratings': '100',\n    'discount_price': '999.00',\n    'actual_price': '1099.00'\n}\nlocal_store.Add_New_Product(product_name='Apple', data=product)\n```\n\n4. Get a list of all the products in the local store:\n\n```python\nproducts = local_store.Show_product_List()\n```\n\n5. Print the list of products:\n\n```python\nfor product in products:\n    print(product)\n```\n\n### LocalAPI\n\nThe `LocalAPI` module provides a simple and intuitive API for creating a local API for accessing data in the store. To use the `LocalAPI` module, you can:\n\n1. Import the `LocalAPI` module:\n\n```python\nfrom localstore.LocalAPI import LocalAPI\n```\n\n2. Create an instance of the `LocalAPI` class:\n\n```python\nlocal_api = LocalAPI()\n```\n\n3. Start the LocalAPI server:\n\n```python\nlocal_api.runServer()\n```\n\n4. Send API requests to the LocalAPI server to perform CRUD operations on data in the local store:\n\n```python\nimport requests\n\n# Get a list of all the products in the local store\nproducts = requests.get('http://localhost:5000/products/show/')\n\n# Print the list of products\nfor product in products.json():\n    print(product)\n```\n\n## Conclusion\n\nThe `localstore` package is a powerful and easy-to-use Python package for managing data in a local store. It is a great choice for a variety of applications, including e-commerce websites, content management systems, data analysis applications, and any other application that needs to store data locally. \n\n## Contributing\n\nContributions to LocalStore are welcome! Please read the [contributing guidelines](https://github.com/colddsam/LocalStore/blob/main/CONTRIBUTING.md) before submitting a pull request.\n\n## License\n\nLocalStore is licensed under the [MIT License](https://github.com/colddsam/LocalStore/blob/b21bdae42f8a31a7ca5e9d954dace06d66c132f6/LICENSE)",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "LocalStore is a Python library that provides various operations on a local database of products, which can be used to store and manage information about items in a local store inventory and it also give mobility to create an local API for the database. Besides this it can convert CSV file to json.",
    "version": "0.2.1",
    "project_urls": {
        "Homepage": "https://github.com/colddsam/LocalStore.git",
        "Repository": "https://github.com/colddsam/LocalStore.git"
    },
    "split_keywords": [
        "data conversion",
        "dataset creation",
        "csv file processing",
        "json serialization",
        "directory traversal",
        "file reading",
        "data cleaning",
        "hashing",
        "data structure manipulation",
        "exception handling",
        "file writing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "149d2117530bbc8e9d5b4fa82f5612db25de625d5f54698ae28559bb8d325df1",
                "md5": "9234a3078199aaf44983e237dfab422a",
                "sha256": "5ec718eb2ed59dc32626ed51c497302031607ab2bfda300452f5374453e20665"
            },
            "downloads": -1,
            "filename": "localstore-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9234a3078199aaf44983e237dfab422a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<4.0",
            "size": 3701442,
            "upload_time": "2024-01-27T13:21:21",
            "upload_time_iso_8601": "2024-01-27T13:21:21.795602Z",
            "url": "https://files.pythonhosted.org/packages/14/9d/2117530bbc8e9d5b4fa82f5612db25de625d5f54698ae28559bb8d325df1/localstore-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3cbe49282773a803f7c8af8cad14e446ff3d0ba7d143223a8d4a19e738603c7f",
                "md5": "1b276870124b9cd1b4bc1fa5676c959a",
                "sha256": "17d07c26a082f924efac48e2cbed046e22cd0c7a68b83bd2c7264ec15b112d5e"
            },
            "downloads": -1,
            "filename": "localstore-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1b276870124b9cd1b4bc1fa5676c959a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<4.0",
            "size": 3660207,
            "upload_time": "2024-01-27T13:21:41",
            "upload_time_iso_8601": "2024-01-27T13:21:41.931590Z",
            "url": "https://files.pythonhosted.org/packages/3c/be/49282773a803f7c8af8cad14e446ff3d0ba7d143223a8d4a19e738603c7f/localstore-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-27 13:21:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "colddsam",
    "github_project": "LocalStore",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "localstore"
}
        
Elapsed time: 2.27393s