semvec/pypi-packages huggingface dataset:
a8logging 1.0.6
A utility for logging events in Python projects
License: MIT

# python-logging

The a8logging function is a utility for logging events in Python projects. It provides a consistent and flexible way to log successes, errors, and other events, and supports multiple output options such as logging to a file or pushing the logs to Elasticsearch.

### Features
- Logs events with the following fields: message, function name, project name, version, and status (success or error).
- Optionally logs error tracebacks in case of errors.
- Supports logging to a file, with the option to specify the file name and log rotation settings.
- Supports logging to Elasticsearch, with the option to specify the Elasticsearch host and port, and other connection settings.
- Provides a generalized function that can be easily integrated into any Python project.

### Installation
To install the log_event function, you will need to install the following dependencies:
- logging: A built-in Python library for logging events.
- traceback: A built-in Python library for printing stack traces in case of errors.
- uuid: A built-in Python library for generating unique IDs.
- elasticsearch: A third-party library for pushing logs to Elasticsearch.
- You can install these dependencies by running the following command:

```bash
pip install -r requirements.txt
```

### Usage
To use the log_event function, you will need to import it into your Python code and call it with the appropriate arguments.
Here is an example of how to log a success event:
```python3
from a8logging import a8logging

a8logging('success', "Test message", function_name='test_function', project_name='test_project', version='1.0.0')
```

This will log a success event with the message 'Test message', the function name 'test_function', the project name 'test_project', and the version '1.0.0'.
To log an error event, you can pass the error argument with an Exception object:
```python3
from a8logging import a8logging

try:
    # Some code that may throw an exception
    raise Exception('Test error')
except Exception as e:
    a8logging('error', "Test error", function_name='test_function', error=e, project_name='test_project', version='1.0.0')
```
This will log an error event with the message 'Test error', the function name 'test_function', the project name 'test_project', and the version '1.0.0'. The error traceback will also be logged.

To log to a file, you can pass the save_to_file argument with a value of True and the file_name argument with the desired file name:
```python3
from a8logging import a8logging

a8logging('success', "Test message", function_name='test_function', project_name='test_project', version='1.0.0', save_to_file=True, file_name='test.txt')
```
This will log the event to the file 'test.txt'.
a8mailer 0.1
A package for sending emails using Outlook and SMTP
License: MIT

# python-mailer

a8mailer is a package for sending emails using Outlook and SMTP.

### Installation
To install a8mailer, run the following command:

```bash
pip install a8mailer
```

### Usage
To use Mailer, import the a8mailer function and call it with the required arguments:
```python
from a8mailer import a8mailer

# Send an email to one recipient
a8mailer('sender@email.com','password',['recipient@email.com'], 'Subject', 'Body')

# Send an email to multiple recipients
a8mailer('sender@email.com','password', ['recipient1@email.com', 'recipient2@email.com'], 'Subject', 'Body')

# Send an email with CC and BCC recipients
a8mailer('sender@email.com','password',['recipient1@email.com', 'recipient2@email.com'], 'Subject', 'Body',
           cc_list=['cc1@email.com', 'cc2@email.com'], bcc_list=['bcc1@email.com', 'bcc2@email.com'])

```

The a8mailer function has the following parameters:

- luser (str): sender email
- lpass (str): sender password
- to_list (required): List of email addresses to send the email to.
- subject (required): Subject of the email.
- body (required): Body of the email.
- cc_list (optional): List of email addresses to CC the email to.
- bcc_list (optional): List of email addresses to BCC the email to.

### License
Mailer is licensed under the MIT License. See the LICENSE file for more details.