Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apprise support for serialization via pickle library #929

Merged
merged 4 commits into from
Aug 19, 2023

Conversation

caronc
Copy link
Owner

@caronc caronc commented Aug 19, 2023

Description:

Related issue (if applicable): #834

Added the ability to Pickle Apprise Objects

# e.g
import apprise
import pickle

# Instantiate our object
apobj = apprise.Apprise()

# Add our URLs
apobj.add("json://localhost")
apobj.add("xml://localhost")
apobj.add("form://localhost")
apobj.add("mailto://user:pass@localhost")

# Now serialize our object for any purpose
serialized  = pickle.dumps(apobj)

# We can re-load our object back into an Apprise Object
apobj2 = pickle.loads(serialized)

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • No lint errors (use flake8)
  • 100% test coverage

Testing

Anyone can help test this source code as follows:

# Create a virtual environment to work in as follows:
python3 -m venv apprise

# Change into our new directory
cd apprise

# Activate our virtual environment
source bin/activate

# Install the branch
pip install git+https://github.com/caronc/apprise.git@834-pickle-apprise

# launch python and try out the example above

@codecov-commenter
Copy link

codecov-commenter commented Aug 19, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (de4701f) 99.52% compared to head (d1ebea9) 99.52%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #929   +/-   ##
=======================================
  Coverage   99.52%   99.52%           
=======================================
  Files         121      122    +1     
  Lines       16177    16250   +73     
  Branches     3312     3321    +9     
=======================================
+ Hits        16100    16173   +73     
  Misses         68       68           
  Partials        9        9           
Files Changed Coverage Δ
apprise/Apprise.py 100.00% <100.00%> (ø)
apprise/AppriseLocale.py 100.00% <100.00%> (ø)
apprise/plugins/NotifyPushMe.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@caronc caronc changed the title 834 pickle apprise Apprise support for serialization via pickle library Aug 19, 2023
@caronc caronc merged commit f55032a into master Aug 19, 2023
12 checks passed
@caronc caronc deleted the 834-pickle-apprise branch August 20, 2023 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants