# DGUPDATER
## Introduction
* THIS IS A NO/LOW CODE TOOL
DGUPDATER is a command line tool which helps developers to update their python applications automatically. It is a simple tool which can be used to update the application without the need of redownloading the whole application. It is very useful when you have a large application and you want to update only a small part of the application.
***Note: This tools is only for releasing new update by the developer and updating the application to the newer version by the client.***
***This tool is not for creating the application or exporting the applicaion. You have to do that yourself.***
## Requirements for using dgupdater
* You need to have a mongodb database preferrably on cloud. You can use mongodb atlas for the same, MongoDB has a serverless db cluster which is very cheap (0.1$ / 1M reads). They also have a good free tier (Shared 512Mb).
After configuring, get the connection string and save it.
* You need to create two database users in the database, one with only read access and one with only write access.
The user with write access will be used by the developer to write data to the database and the user with read access will be used by the client to read data from the database.
* When initializing the application, it will ask two connection strings, one with write access and one with read access.
So replace the username and password in the connection string with the username and password of the user with write and read access respectively.
## Installation
You can install this package from pypi
* Using PIP
```
pip install dgupdater
```
* Using Poetry
```
poetry add dgupdater
```
* Manually
```
git clone https://github.com/Ashif4354/DGUpdater.git
cd dgupdater
pip install .
```
## Initialization
You have to open a terminal and navigate into the directory which you want to initialize for auto updation. Then run the following command:
```
dgupdater init
```
* This will ask you for the application name, mongodb connection string with read access, mongodb connection string with write access. After providing the required information, it will create a file named 'dgupdaterconf.json' in the current directory. This file will be used to store the configuration of the application.
* The mongodbconnection string with write access will be stored in a different place as follows
```
Windows: C:/Users/<username>/AppData/local/DarkGlance/dgupdater/dgupdaterconf.json
Linux: /home/<username>/.config/DarkGlance/dgupdater/dgupdaterconf.json
Mac: Users/<username>/Library/Application Support/DarkGlance/dgupdater/dgupdaterconf.json
```
* Then it will check if the application is already registered in the database or not. If it is not registered, it will register the application in the database. or it will ask whether to overwrite the application details.
* It will also create a file named '.dgupdaterignore' in the current directory.
this file works just like the '.gitignore' file. you can add the files and directories which you want to ignore while updating the application.
* If you want to change the mongodb connection string, you can do it by running 'dgupdater init' again and providing the new connection string.
* After initializing the application, you can continue building the application and when you are ready to release new update, you can commit the changes.
## Commiting the changes
* After making the changes in the application, you can commit the changes by running the following command:
```
dgupdater commit
```
* This will ask for the new version number of the application.
* After providing the version number, it will ask confirmation to commit the changes. If you confirm, it will commit the changes.
* In this process the following things will happen:
1. The files and directories mentioned in the .dgupdaterignore file will be ignored.
2. It will create a directory named 'dgupdater_release' in the root directory
3. It will create another directory named 'chunks' in the dgupdater_release directory.
4. It will then create a new 'dgupdaterconf.json' file in the dgupdater_release directory with the updated data.
5. It will then divide the files into smaller chunks and save them in the chunks directory.
6. The commiting process is complete.
* Now you can publish the new changes.
## Publishing new changes
* After commiting the changes, you can publish the application by running the following command:
```
dgupdater publish
```
* This willl ask confirmation to publish the application. If you confirm, it will publish the application.
* In this process the following things will happen:
1. It will verify all the release files
2. It will update the config json object in db with new data
3. It will delete any previous release files(chunks) from the database if it exists.
4. It will upload the new release files(chunks) to the database.
5. It will make the application ready to be updated by updating the 'update_ready' field in the config json object to true.
* The application is now ready to be updated by the client.
## check_update()
* You need to call 'check_update()' in the entry point of the application or wherever you seem fit to call it, to check for the new updates.
```python
from dgupdater import check_update
# Call this function in the entry point of the application
check_update()
```
* In this process the following things will happen:
1. It will try to locate the 'dgupdaterconf.json' file. and the location where the file is found will be considered as the root directory of the application.
2. Then it will check if a new update is available in the db or not
3. Then it will ask the user if they want to update the application or not.
4. If the user confirms, it will start the updation process, and close the current window.
5. Then it will download all the chunks from the database and merge them to create the new release files.
6. Then it will replace the old files with the new files.
7. It will also delete any old version files which are not present in the new version.
8. The application is now updated to the new version.
9. The user needs to restart the application to see the changes.
Raw data
{
"_id": null,
"home_page": null,
"name": "dgupdater",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "dgupdater, auto updater, cli tool, python, pyupdater, python application, auto updation, auto update, update, cli, command line interfaceno code, low code, no code tool, mongodb, pymongo, click",
"author": "DarkGlance",
"author_email": "darkglance.developer@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/25/ae/1dc55fd6057589c1481248161edf512e5614f2f4649989bf6f03a01ee536/dgupdater-1.0.3.tar.gz",
"platform": null,
"description": "# DGUPDATER\n\n## Introduction\n\n* THIS IS A NO/LOW CODE TOOL\n\nDGUPDATER is a command line tool which helps developers to update their python applications automatically. It is a simple tool which can be used to update the application without the need of redownloading the whole application. It is very useful when you have a large application and you want to update only a small part of the application. \n\n***Note: This tools is only for releasing new update by the developer and updating the application to the newer version by the client.***\n***This tool is not for creating the application or exporting the applicaion. You have to do that yourself.***\n\n## Requirements for using dgupdater\n\n* You need to have a mongodb database preferrably on cloud. You can use mongodb atlas for the same, MongoDB has a serverless db cluster which is very cheap (0.1$ / 1M reads). They also have a good free tier (Shared 512Mb). \nAfter configuring, get the connection string and save it.\n\n* You need to create two database users in the database, one with only read access and one with only write access.\nThe user with write access will be used by the developer to write data to the database and the user with read access will be used by the client to read data from the database.\n\n* When initializing the application, it will ask two connection strings, one with write access and one with read access.\n So replace the username and password in the connection string with the username and password of the user with write and read access respectively.\n\n## Installation\nYou can install this package from pypi \n\n* Using PIP\n```\npip install dgupdater\n```\n\n* Using Poetry\n```\npoetry add dgupdater\n```\n* Manually\n```\ngit clone https://github.com/Ashif4354/DGUpdater.git\ncd dgupdater\npip install .\n```\n\n## Initialization\nYou have to open a terminal and navigate into the directory which you want to initialize for auto updation. Then run the following command:\n\n```\ndgupdater init\n```\n\n* This will ask you for the application name, mongodb connection string with read access, mongodb connection string with write access. After providing the required information, it will create a file named 'dgupdaterconf.json' in the current directory. This file will be used to store the configuration of the application.\n\n* The mongodbconnection string with write access will be stored in a different place as follows\n```\nWindows: C:/Users/<username>/AppData/local/DarkGlance/dgupdater/dgupdaterconf.json\nLinux: /home/<username>/.config/DarkGlance/dgupdater/dgupdaterconf.json\nMac: Users/<username>/Library/Application Support/DarkGlance/dgupdater/dgupdaterconf.json\n```\n\n* Then it will check if the application is already registered in the database or not. If it is not registered, it will register the application in the database. or it will ask whether to overwrite the application details.\n\n* It will also create a file named '.dgupdaterignore' in the current directory.\nthis file works just like the '.gitignore' file. you can add the files and directories which you want to ignore while updating the application.\n\n* If you want to change the mongodb connection string, you can do it by running 'dgupdater init' again and providing the new connection string.\n\n* After initializing the application, you can continue building the application and when you are ready to release new update, you can commit the changes.\n\n## Commiting the changes\n\n* After making the changes in the application, you can commit the changes by running the following command:\n\n```\ndgupdater commit\n```\n\n* This will ask for the new version number of the application. \n* After providing the version number, it will ask confirmation to commit the changes. If you confirm, it will commit the changes.\n\n* In this process the following things will happen:\n\n 1. The files and directories mentioned in the .dgupdaterignore file will be ignored.\n 2. It will create a directory named 'dgupdater_release' in the root directory\n 3. It will create another directory named 'chunks' in the dgupdater_release directory.\n 4. It will then create a new 'dgupdaterconf.json' file in the dgupdater_release directory with the updated data.\n 5. It will then divide the files into smaller chunks and save them in the chunks directory.\n 6. The commiting process is complete.\n\n* Now you can publish the new changes.\n\n## Publishing new changes\n\n* After commiting the changes, you can publish the application by running the following command:\n\n```\ndgupdater publish\n```\n\n* This willl ask confirmation to publish the application. If you confirm, it will publish the application.\n* In this process the following things will happen:\n\n 1. It will verify all the release files\n 2. It will update the config json object in db with new data\n 3. It will delete any previous release files(chunks) from the database if it exists.\n 4. It will upload the new release files(chunks) to the database.\n 5. It will make the application ready to be updated by updating the 'update_ready' field in the config json object to true.\n\n* The application is now ready to be updated by the client.\n\n## check_update()\n\n* You need to call 'check_update()' in the entry point of the application or wherever you seem fit to call it, to check for the new updates.\n```python\nfrom dgupdater import check_update\n\n# Call this function in the entry point of the application\ncheck_update()\n```\n* In this process the following things will happen:\n\n 1. It will try to locate the 'dgupdaterconf.json' file. and the location where the file is found will be considered as the root directory of the application.\n 2. Then it will check if a new update is available in the db or not\n 3. Then it will ask the user if they want to update the application or not.\n 4. If the user confirms, it will start the updation process, and close the current window.\n 5. Then it will download all the chunks from the database and merge them to create the new release files.\n 6. Then it will replace the old files with the new files.\n 7. It will also delete any old version files which are not present in the new version.\n 8. The application is now updated to the new version.\n 9. The user needs to restart the application to see the changes.\n\n \n\n \n",
"bugtrack_url": null,
"license": null,
"summary": "A NO/LOW Code CLI based auto updation assistant tool for python applications",
"version": "1.0.3",
"project_urls": {
"Github": "https://github.com/Ashif4354/dgupdater"
},
"split_keywords": [
"dgupdater",
" auto updater",
" cli tool",
" python",
" pyupdater",
" python application",
" auto updation",
" auto update",
" update",
" cli",
" command line interfaceno code",
" low code",
" no code tool",
" mongodb",
" pymongo",
" click"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8cd8094c69a65b0f5b22745994fe38f5fa06b856b76aceeeb2b6465394cbed63",
"md5": "f9393132176d89543f6c55f825d0f8f4",
"sha256": "bf7f5d4e47d05de6051a9200cbcee74967435e7e82a946053a37aad9799cb15a"
},
"downloads": -1,
"filename": "dgupdater-1.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f9393132176d89543f6c55f825d0f8f4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 21565,
"upload_time": "2024-10-23T04:00:53",
"upload_time_iso_8601": "2024-10-23T04:00:53.908760Z",
"url": "https://files.pythonhosted.org/packages/8c/d8/094c69a65b0f5b22745994fe38f5fa06b856b76aceeeb2b6465394cbed63/dgupdater-1.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "25ae1dc55fd6057589c1481248161edf512e5614f2f4649989bf6f03a01ee536",
"md5": "373834eaaf05f830a701832477cffb13",
"sha256": "df58dd832dcb5d3b90f377fd0e99d63f4bf365ea6b8a803f86149b452e382d34"
},
"downloads": -1,
"filename": "dgupdater-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "373834eaaf05f830a701832477cffb13",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 15077,
"upload_time": "2024-10-23T04:00:55",
"upload_time_iso_8601": "2024-10-23T04:00:55.491167Z",
"url": "https://files.pythonhosted.org/packages/25/ae/1dc55fd6057589c1481248161edf512e5614f2f4649989bf6f03a01ee536/dgupdater-1.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-23 04:00:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Ashif4354",
"github_project": "dgupdater",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "dgupdater"
}