Getting started
===================================

**AppData** is a Python library to access app data paths based
on the operating system the app is running on.

===============
Install AppData
===============
To install AppData package from PyPI run the following command
in your terminal (Python and Pip should be installed)

.. code-block:: none

    pip install appdata

After that you could use the functionality of this library.

=============
Using AppData
=============
The main class that is used by the package is ``AppDataPaths``:

.. code-block:: python3

    from appdata import AppDataPaths

The default initialization:

.. code-block:: python3

    app_paths = AppDataPaths()
    app_paths.setup()

By default the current working directory name is used as name for
app data folder. The folder destination depends on the operating
system your app is ranning on. ``setup()`` function allows to create
folders that are not created. To delete all the files generated by
the library use:

.. code-block:: python3

    app_paths.clear(everything=True)

To check if ``setup()`` is required use:

.. code-block:: python3

    app_paths.require_setup

The ``AppDataPaths`` class allows to access different paths for
the application.

Application data path
---------------------

To access application data root path:

.. code-block:: python3

    app_paths.app_data_path


Config path
-----------

To access application config file path use:

.. code-block:: python3

    app_paths.config_path

Or if you would like to get specific config file path:

.. code-block:: python3

    app_paths.get_config_path(
        name='some_name',
        ext='.conf'
    )

Logs path
---------

To access logs folder path use:

.. code-block:: python3

    app_paths.logs_path

To access default log file use:

.. code-block:: python3

    app_paths.log_file_path

Or if you would like to get specific log file:

.. code-block:: python3

    app_paths.get_log_file_path(name='some_log')
