Skip to main content

A basic unofficial batmanwonderwoman.com (bmww) api

Project description

bmww-api

Use : pip install bmww-api==0.0.9

to install this module

Pypi url : https://pypi.org/project/bmww-api/

Disclaimers:

  • This is not an official api and it is quite weak but it gets the job done.

  • DO NOT ABUSE REQUESTS SINCE IT CAN BE HARMFUL FOR THE WEB PAGE.

Notes:

  • As said before this is not an official api and it was made by one person, so if you see any errors in the code or see a better way to do code it and know how to do it, you are welcome to edit it.

  • Information like genres or information that can be a list (ex: genres, categories, challenges, series) can't be accessed individually due to the way that the html was written. Again if you find a way to fix it or make it possible to access this information individually you are welcome to do it

  • If you want to access information like the ones stated above you would have to do .complete_info this will get the work's complete info

  • I may be updating this project with new features, however i don't really have much time to do it and since this is one of my first times using beautiful soup the code maybe a bit messy and with a lot of errors.

Quick guide on how to use:

#import module
from bmwwAPI import bmww

#create api object
api = bmww()


# create work from api '487' being the id of the work/fanfiction
# https://batmanwonderwoman.com/fanfiction/viewstory.php?sid=487 the last 3 numbers of the url are the id of the work, those are the three numbers you need
# if an id is not given the only information available is to get a random story

# create a work object based on the api
work = api.work(#id)

# some of the functions of the api

# get information out of a work/fanfic/series

work_info = [

  work.title,           # title
  work.author,          # author
  work.reviews,         # reviews
  work.chapters,        # chapters
  work.completed,       # if its completed
  work.words,           # how many words
  work.read,            # times read
  work.published,       # publish date
  work.updated,         # last time updated
  work.url,             # its url
  work.summary,         # its summary
  work.complete_info    # the entire work's info
  work.rand_id          # the random story id
  work.random_story_url         # the random story url

]


# get information out of an users profile, this gets the information that the user chose to share, so no funny business here.
# you don't have to specify any work's id except the users id

# create an user object based on the api
user = api.users()

# some of the information that you can get from user's profiles

# keep in mind that some of this information may not be available if the user chose not to share it

user_info = [

  user.penname,              # gets the user nickname
  user.real_name,            # gets the user real name   
  user.member_status,        # gets the user member status
  user.bio,                  # gets the user bio
  user.user_url,             # gets the user page url
  user.beta_reader           # gets if the user is a beta reader
  user.gender                # gets the user gender
  user.recent_story          # gets the user's last published or updated story
  user.stories               # gets the number of user published stories
  user.series                # gets the number of user series
  user.reviews               # gets the number of the user reviews
  user.challenges            # gets the number of the user challenges
  user.favorite_series       # gets the number of the user favorite series
  user.user_favorites        # gets the number of user favorites

]

For more information in how to use the api, refer to example_code.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bmww-api-0.0.9.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

bmww_api-0.0.9-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file bmww-api-0.0.9.tar.gz.

File metadata

  • Download URL: bmww-api-0.0.9.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for bmww-api-0.0.9.tar.gz
Algorithm Hash digest
SHA256 0640918605b68f5b4c2a1f049ac61195d02dbecd1bf994bcdc80b1d11a6b3830
MD5 1ccafa7156b646185910f7e51b70b05b
BLAKE2b-256 baf1ce99f7f3d0933ffb640909888e8893e9fa7ff807caaba0bba2dfbf198751

See more details on using hashes here.

File details

Details for the file bmww_api-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: bmww_api-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for bmww_api-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 6bb588a21ac3816228c2b07a85fe7556d9995b595c7a2fa2beef0cc9b8a32d44
MD5 af25b9520f74458acd4b623b86a57aec
BLAKE2b-256 c59d3f28881643cc63ad686ddd42f302465eba4b97bed89b42a104f62d435019

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page