Endpoints
Endpoints for Ravelry
pyravelry.endpoints.ColorFamiliesResource
¶
Bases: BaseEndpoint
Endpoint for Color Families.
Attributes:
| Name | Type | Description |
|---|---|---|
BaseEndpoint |
AnyUrl
|
The endpoint for colorfamily. |
output_model |
ColorFamiliesModel
|
The pydantic model that the api output is validated against. |
Methods:
| Name | Description |
|---|---|
list |
returns all color families. |
Color Family Ravelry API documentation
Source code in src/pyravelry/endpoints/color_families.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
pyravelry.endpoints.ColorFamiliesResource.list()
¶
Retrieves all color families from Ravelry.
Source code in src/pyravelry/endpoints/color_families.py
25 26 27 28 29 30 | |
pyravelry.endpoints.CommentsResource
¶
Bases: BaseEndpoint
Endpoint for Comments.
Methods:
| Name | Description |
|---|---|
create |
Post a comment related to an object. |
delete |
Delete a specific comment by ID. |
list |
Get list of comments left by a user. |
Comments Ravelry API documentation
Source code in src/pyravelry/endpoints/comments.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
pyravelry.endpoints.CommentsResource.create(type_, commented_id, body, reply_to_id)
¶
Post a comment related to an object (project, pattern, yarn, or stash).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type_
|
Literal['project', 'pattern', 'yarn', 'stash']
|
The type of item being commented on. |
required |
commented_id
|
int
|
ID of the item being commented on. |
required |
body
|
str
|
Comment body. |
required |
reply_to_id
|
int
|
ID of the comment being replied to. Restricted to item owners. |
required |
Returns:
| Type | Description |
|---|---|
CommentFullModel
|
The published comment |
Source code in src/pyravelry/endpoints/comments.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
pyravelry.endpoints.CommentsResource.delete(id_)
¶
Delete a comment by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
int
|
The comment ID to delete. |
required |
Returns:
| Type | Description |
|---|---|
CommentFullModel
|
The deleted comment. |
Source code in src/pyravelry/endpoints/comments.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
pyravelry.endpoints.CommentsResource.list(username, page=1, page_size=25)
¶
Get list of comments left by a specific user.
Source code in src/pyravelry/endpoints/comments.py
74 75 76 77 78 79 80 81 82 83 84 85 | |
pyravelry.endpoints.CurrentUserResource
¶
Bases: BaseEndpoint
Endpoint for the currently authenticated user.
Attributes:
| Name | Type | Description |
|---|---|---|
endpoint |
str
|
The endpoint for current_user. |
output_model |
UserModel
|
The pydantic model that the api output is validated against. |
Methods:
| Name | Description |
|---|---|
get |
Returns the authenticated user's details. |
Current User Ravelry API documentation
Source code in src/pyravelry/endpoints/current_user.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
pyravelry.endpoints.CurrentUserResource.get()
¶
Retrieves the details of the currently authenticated user.
Source code in src/pyravelry/endpoints/current_user.py
23 24 25 26 27 28 | |
pyravelry.endpoints.FiberAttributesResource
¶
Bases: BaseEndpoint
Endpoint for Fiber Attributes.
Attributes:
| Name | Type | Description |
|---|---|---|
BaseEndpoint |
AnyUrl
|
The endpoint for fiber attributes. |
Methods:
| Name | Description |
|---|---|
list |
returns all fiber attributes. |
Fiber Attributes Ravelry API documentation
Source code in src/pyravelry/endpoints/fiber_attributes.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |
pyravelry.endpoints.FiberAttributesResource.list()
¶
List the current fiber attributes
Endpoint: GET /fiber_attributes.json
Source code in src/pyravelry/endpoints/fiber_attributes.py
22 23 24 25 26 27 28 29 | |
pyravelry.endpoints.FiberCategoriesResource
¶
Bases: BaseEndpoint
Endpoint for Fiber Categories.
Attributes:
| Name | Type | Description |
|---|---|---|
BaseEndpoint |
AnyUrl
|
The endpoint for fiber categories. |
Methods:
| Name | Description |
|---|---|
list |
returns all fiber categories. |
Fiber Categories Ravelry API documentation
Source code in src/pyravelry/endpoints/fiber_categories.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
pyravelry.endpoints.FiberCategoriesResource.list()
¶
List the current fiber categories Endpoint: GET /fiber_categories.json
Source code in src/pyravelry/endpoints/fiber_categories.py
22 23 24 25 26 27 28 | |
pyravelry.endpoints.NeedlesResource
¶
Bases: BaseEndpoint
Needles endpoint for Ravelry.
Handles user needle inventories, global needle sizes, and needle types.
Source code in src/pyravelry/endpoints/needles.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
pyravelry.endpoints.NeedlesResource.list(username)
¶
Get needle records for a specific user.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
username
|
str
|
Username or integer ID of the user to retrieve needles for. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
NeedleRecordsListModel |
NeedleRecordListModel
|
The user's list of needle records. |
Source code in src/pyravelry/endpoints/needles.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
pyravelry.endpoints.NeedlesResource.sizes(craft=None)
¶
Get available sizes for each needle type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
craft
|
str | None
|
Filter by tool type. "crochet" for hooks only, "knitting" for knitting needles only. Defaults to None. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
NeedleSizesListModel |
NeedleSizesModel
|
The list of available needle sizes. |
Source code in src/pyravelry/endpoints/needles.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
pyravelry.endpoints.NeedlesResource.types()
¶
Get all global needle types.
Returns:
| Name | Type | Description |
|---|---|---|
NeedleTypesModel |
NeedleTypesModel
|
The list of available needle types. |
Source code in src/pyravelry/endpoints/needles.py
59 60 61 62 63 64 65 66 67 68 69 | |
pyravelry.endpoints.PeopleResource
¶
Bases: BaseEndpoint
People endpoint for Ravelry.
People Ravelry API documentation
Source code in src/pyravelry/endpoints/people.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
pyravelry.endpoints.PeopleResource.show(username)
¶
Get a user's profile information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
username
|
str
|
Username or integer ID of the user to lookup. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
UserFullModel |
UserModel
|
The full user profile data. |
Source code in src/pyravelry/endpoints/people.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
pyravelry.endpoints.PeopleResource.update(username, first_name=None, about_me=None, fave_colors=None, fave_curse=None, location=None)
¶
Update a user's profile. Requires profile-write permission.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
username
|
str
|
Username or integer ID of the user to update. |
required |
first_name
|
str | None
|
User's first name. |
None
|
about_me
|
str | None
|
User's "About Me" description. |
None
|
fave_colors
|
str | None
|
User's favorite colors. |
None
|
fave_curse
|
str | None
|
User's favorite curse word. |
None
|
location
|
str | None
|
User's location. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
UserFullModel |
UserModel
|
The updated user profile. |
Source code in src/pyravelry/endpoints/people.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
pyravelry.endpoints.SearchResource
¶
Bases: BaseEndpoint
Search endpoint for Ravelry.
Search Ravelry API documentation
Source code in src/pyravelry/endpoints/search.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
pyravelry.endpoints.SearchResource.query(query, limit=10, types=None)
¶
Perform a global search.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Any fulltext string |
required |
limit
|
int
|
integer between 1 and 50 |
10
|
types
|
str | list
|
Optional. space delineated string or list of strings for the types of categories that you are searching. See client.search.param_model.model_json_schema() for available types. |
None
|
Usage
search.query(query="merino", limit=10, types=["Yarn"])
Source code in src/pyravelry/endpoints/search.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
pyravelry.endpoints.YarnAttributesResource
¶
Bases: BaseEndpoint
Endpoint for Color Families.
Attributes:
| Name | Type | Description |
|---|---|---|
BaseEndpoint |
AnyUrl
|
The endpoint for yarn attributes. |
Methods:
| Name | Description |
|---|---|
list |
returns all yarn attributes. |
Yarn Attributes Ravelry API documentation
Source code in src/pyravelry/endpoints/yarn_attributes.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |
pyravelry.endpoints.YarnAttributesResource.list()
¶
List the current yarn attributes.
Endpoint: GET /yarn_attributes/groups.json
Source code in src/pyravelry/endpoints/yarn_attributes.py
22 23 24 25 26 27 28 29 | |
pyravelry.endpoints.YarnCompaniesResource
¶
Bases: BaseEndpoint
Endpoint for yarn company specific operations.
Yarn Companies Ravelry API documentation
Source code in src/pyravelry/endpoints/yarn_companies.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
pyravelry.endpoints.YarnCompaniesResource.query(query=None, page=1, page_size=48, sort='best')
¶
Search the yarn company directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str | None
|
Search term for fulltext searching. |
None
|
page
|
int
|
Result page to retrieve. |
1
|
page_size
|
int
|
Number of results per page. |
48
|
sort
|
str
|
Sort order (e.g., 'best', 'best_'; reverse order with _ suffix) |
'best'
|
Source code in src/pyravelry/endpoints/yarn_companies.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
pyravelry.endpoints.YarnWeightsResource
¶
Bases: BaseEndpoint
Endpoint for Color Families.
Attributes:
| Name | Type | Description |
|---|---|---|
BaseEndpoint |
AnyUrl
|
The endpoint for yarn weights. |
Methods:
| Name | Description |
|---|---|
list |
returns all yarn weights. |
Yarn Weights Ravelry API documentation
Source code in src/pyravelry/endpoints/yarn_weights.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |
pyravelry.endpoints.YarnWeightsResource.list()
¶
List the current yarn weights.
Endpoint: GET /yarn_weights.json
Source code in src/pyravelry/endpoints/yarn_weights.py
22 23 24 25 26 27 28 29 | |