kopia lustrzana https://github.com/dsblank/activitypub
Removed requirements; loads all DB stubs; error when attempting to use without dependencies
rodzic
da8d6af5e6
commit
9915053bc5
20
README.md
20
README.md
|
@ -1,5 +1,25 @@
|
||||||
# activitypub
|
# activitypub
|
||||||
|
|
||||||
|
This is a Python library to use with
|
||||||
|
[ActivityPub](https://en.wikipedia.org/wiki/ActivityPub). ActivityPub
|
||||||
|
is an API for an open, distributed, social network.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
You can install the development version of activitypub with:
|
||||||
|
|
||||||
|
```
|
||||||
|
pip install git+git://github.com/dsblank/activitypub
|
||||||
|
```
|
||||||
|
|
||||||
|
or the last packaged version with:
|
||||||
|
|
||||||
|
```
|
||||||
|
pip install activitypub
|
||||||
|
```
|
||||||
|
|
||||||
|
## Abstractions
|
||||||
|
|
||||||
This module is designed to be a generally useful ActivityPub library in Python. It targets three different levels of use:
|
This module is designed to be a generally useful ActivityPub library in Python. It targets three different levels of use:
|
||||||
|
|
||||||
* ActivityPub object API
|
* ActivityPub object API
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
from pymongo import MongoClient
|
try:
|
||||||
|
from pymongo import MongoClient
|
||||||
|
except:
|
||||||
|
def MongoClient(*args, **kwargs):
|
||||||
|
raise Exception("You need to install pymongo")
|
||||||
|
|
||||||
from .base import Database, Table
|
from .base import Database, Table
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
from redis_collections import List
|
try:
|
||||||
import redis
|
import redis
|
||||||
|
from redis_collections import List
|
||||||
|
from_url = redis.StrictRedis.from_url
|
||||||
|
except:
|
||||||
|
def from_url(*args, **kwargs):
|
||||||
|
raise Exception("You need to install redis and redis_collections")
|
||||||
|
|
||||||
from .listdb import ListTable
|
from .listdb import ListTable
|
||||||
from .base import Database
|
from .base import Database
|
||||||
|
|
||||||
|
@ -16,5 +22,5 @@ class RedisDatabase(Database):
|
||||||
* "redis://localhost:6379"
|
* "redis://localhost:6379"
|
||||||
* "redis://localhost:6379/0"
|
* "redis://localhost:6379/0"
|
||||||
"""
|
"""
|
||||||
self.redis = redis.StrictRedis.from_url(url, **kwargs) if url else None
|
self.redis = from_url(url, **kwargs) if url else None
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
from sqlalchemy import create_engine, inspect
|
|
||||||
from sqlalchemy.orm import scoped_session, sessionmaker
|
try:
|
||||||
from sqlalchemy.pool import StaticPool
|
from sqlalchemy import create_engine, inspect
|
||||||
|
from sqlalchemy.orm import scoped_session, sessionmaker
|
||||||
|
from sqlalchemy.pool import StaticPool
|
||||||
|
except:
|
||||||
|
def create_engine(*args, **kwargs):
|
||||||
|
raise Exception("You need to install sqlalchemy")
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
pymongo
|
|
2
setup.py
2
setup.py
|
@ -29,7 +29,7 @@ setup(name='activitypub',
|
||||||
author='Douglas S. Blank',
|
author='Douglas S. Blank',
|
||||||
author_email='doug.blank@gmail.com',
|
author_email='doug.blank@gmail.com',
|
||||||
url='https://github.com/dsblank/activitypub',
|
url='https://github.com/dsblank/activitypub',
|
||||||
install_requires=['pymongo'],
|
install_requires=[],
|
||||||
packages=find_packages(include=['activitypub', 'activitypub.*']),
|
packages=find_packages(include=['activitypub', 'activitypub.*']),
|
||||||
include_data_files = True,
|
include_data_files = True,
|
||||||
test_suite = 'nose.collector',
|
test_suite = 'nose.collector',
|
||||||
|
|
Ładowanie…
Reference in New Issue