Skip to content

pyravelry

Release Build status Commit activity License

This is python wrapper for the Ravelry API (a database of knitting / crocheting patterns).

Use of this API wrapper requires a Ravelry Account and a username and apikey as specified in the HTTP Basic Auth section of the Ravelry API Documentation.

Quick Start:

$pip install pyravelry
$python -i
>>> from pyravelry import Client, Settings
>>> settings = Settings(RAVELRY_USERNAME=..., RAVELRY_API_KEY=...)
>>> client = Client(settings=settings)
>>> results = client.search.query(query="merino", limit=10, types="Yarn")
>>> results[0].title
'MerinoSeide'

I've checked the API endpoints / models that are currently supported from the official Ravelry Documentation. The crossed ones are not planned to ever be supported:

Endpoints:

  • /color_families
  • /current_user
  • /fiber_attributes
  • /fiber_categories
  • /search
  • /yarn_weights
  • /app
  • /bundled_items
  • /bundles
  • /carts
  • /comments # doesn't allow retrieval of anyone else's comments.
  • /deliveries
  • /designers
  • /drafts
  • /favorites
  • /fiber (base level)
  • /fiber_attributes_groups (base level)
  • /forum_posts (base level)
  • /forums (base level)
  • /friends
  • /groups
  • /in_store_sales
  • /languages
  • /library
  • /messages
  • /needles
  • /packs
  • /pages
  • /pattern_attributes
  • /pattern_categories
  • /pattern_source_types
  • /pattern_sources
  • /patterns
  • /people
  • /photos
  • /product_attachments
  • /products
  • /projects
  • /queue
  • /saved_searches
  • /shops
  • /stash
  • /stores
  • /topics
  • /upload
  • /volumes
  • /yarn_attributes
  • /yarn_companies
  • /yarns

Models:

  • Activity
  • Ad
  • AttributeGroup
  • Bookmark
  • Bundle
  • BundledItem
  • Business
  • Cart
  • CartItem
  • Collection
  • ColorFamily
  • Colorway
  • CombinedCart
  • ComponentYarn
  • Craft
  • Delivery
  • Document
  • DownloadLink
  • DraftComponentYarn
  • DraftErrataLink
  • DraftNeedleSize
  • DraftPattern
  • DraftPatternYarn
  • FiberAttribute
  • FiberAttributeGroup
  • FiberCategory
  • FiberPack
  • FiberStash
  • FiberType
  • Forum
  • ForumPost
  • ForumPreference
  • ForumSet
  • ForumStatisticSummary
  • Friendship
  • Group
  • InStoreSale
  • Invoice
  • InvoiceLineItem
  • Language
  • Message
  • NeedleRecord
  • NeedleSize
  • NeedleType
  • Pack
  • Pattern
  • PatternAttribute
  • PatternAuthor
  • PatternCategory
  • PatternClassification
  • PatternLanguage
  • PatternNeedleSize
  • PatternSource
  • PatternSourceType
  • PatternTagging
  • Photo
  • Printing
  • Product
  • ProductAttachment
  • ProductNotification
  • Project
  • ProjectStatus
  • QueuedProject
  • QueuedStash
  • Saleable
  • SavedSearch
  • Shop
  • ShopCustomer
  • ShopSchedule
  • SocialSite
  • Stash
  • StashStatus
  • Store
  • Tool
  • Topic
  • UnifiedStash
  • User
  • UserSite
  • Volume
  • VolumeAttachment
  • Yarn
  • YarnAttributeGroup
  • YarnCompany
  • YarnCountry
  • YarnFiber
  • YarnProvenance
  • YarnWeight