Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions twitter_openapi_python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "twitter_openapi_python"
version = "0.0.29"
version = "0.0.32"
description = "Twitter OpenAPI"
authors = ["fa0311 <yuki@yuki0311.com>"]
license = "proprietary" # or "AGPL-3.0-only"
Expand All @@ -14,7 +14,7 @@ include = ["twitter_openapi_python/py.typed"]
python = "^3.7"
pydantic = ">=2.6"

twitter-openapi-python-generated = "0.0.27"
twitter-openapi-python-generated = "0.0.29"

[tool.poetry.dev-dependencies]

Expand Down
Binary file modified twitter_openapi_python/requirements.txt
Binary file not shown.
4 changes: 2 additions & 2 deletions twitter_openapi_python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from setuptools import find_packages, setup

NAME = "twitter_openapi_python"
VERSION = "0.0.29"
VERSION = "0.0.32"
PYTHON_REQUIRES = ">=3.7"
REQUIRES = [
"twitter_openapi_python_generated == 0.0.27",
"twitter_openapi_python_generated == 0.0.29",
"pydantic >= 2.6",
]
GITHUB_RAW_URL = (
Expand Down
19 changes: 7 additions & 12 deletions twitter_openapi_python/twitter_openapi_python/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ def get_v11_post_api(self) -> V11PostApiUtils:


class TwitterOpenapiPython:
hash: str = "4b27150977e1bdd807de8969dc0ddd7918ac9923"
hash: str = "8b2d05d1525404a29730f740a259026502be7cbd"
placeholder_url = "https://raw.githubusercontent.com/fa0311/twitter-openapi/{hash}/src/config/placeholder.json"
header = "https://raw.githubusercontent.com/fa0311/latest-user-agent/refs/heads/main/header.json"
access_token: str = "AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA"
access_token: str = (
"AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA"
)
twitter_url: str = "https://x.com/home"
additional_browser_headers = {}
additional_api_headers = {}
Expand All @@ -73,9 +75,7 @@ def get_header(self) -> tuple[dict[str, str], dict[str, str]]:
ignore = ["host", "connection"]

def getHader(name: str) -> dict[str, str]:
return {
key: value for key, value in data[name].items() if key not in ignore
}
return {key: value for key, value in data[name].items() if key not in ignore}

return (
{
Expand Down Expand Up @@ -107,17 +107,12 @@ def remove_prefix(self, text: str) -> str:
def kebab_to_upper_camel(self, text: dict[str, Any]) -> dict[str, Any]:
res = {}
for key, value in text.items():
new_key = "".join(
[x.capitalize() for x in self.remove_prefix(key).split("-")]
)
new_key = "".join([x.capitalize() for x in self.remove_prefix(key).split("-")])
res[new_key] = value
return res

def cookie_normalize(self, cookie: list[str]) -> dict[str, str]:
return {
x.split("; ")[0].split("=")[0]: x.split("; ")[0].split("=")[1]
for x in cookie
}
return {x.split("; ")[0].split("=")[0]: x.split("; ")[0].split("=")[1] for x in cookie}

def cookie_to_str(self, cookie: dict[str, str]) -> str:
return "; ".join([f"{key}={value}" for key, value in cookie.items()])
Expand Down
15 changes: 15 additions & 0 deletions twitter_openapi_python_generated/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,16 @@ docs/TimelineTerminateTimeline.md
docs/TimelineTimelineCursor.md
docs/TimelineTimelineItem.md
docs/TimelineTimelineModule.md
docs/TimelineTombstone.md
docs/TimelineTopicContext.md
docs/TimelineTweet.md
docs/TimelineUser.md
docs/TimelineV2.md
docs/Timestamp.md
docs/TombstoneEntity.md
docs/TombstoneInfo.md
docs/TombstoneRef.md
docs/TombstoneRichText.md
docs/TopicContext.md
docs/Tracing.md
docs/TrendResults.md
Expand Down Expand Up @@ -487,11 +492,16 @@ test/test_timeline_terminate_timeline.py
test/test_timeline_timeline_cursor.py
test/test_timeline_timeline_item.py
test/test_timeline_timeline_module.py
test/test_timeline_tombstone.py
test/test_timeline_topic_context.py
test/test_timeline_tweet.py
test/test_timeline_user.py
test/test_timeline_v2.py
test/test_timestamp.py
test/test_tombstone_entity.py
test/test_tombstone_info.py
test/test_tombstone_ref.py
test/test_tombstone_rich_text.py
test/test_topic_context.py
test/test_tracing.py
test/test_trend_results.py
Expand Down Expand Up @@ -789,11 +799,16 @@ twitter_openapi_python_generated/models/timeline_terminate_timeline.py
twitter_openapi_python_generated/models/timeline_timeline_cursor.py
twitter_openapi_python_generated/models/timeline_timeline_item.py
twitter_openapi_python_generated/models/timeline_timeline_module.py
twitter_openapi_python_generated/models/timeline_tombstone.py
twitter_openapi_python_generated/models/timeline_topic_context.py
twitter_openapi_python_generated/models/timeline_tweet.py
twitter_openapi_python_generated/models/timeline_user.py
twitter_openapi_python_generated/models/timeline_v2.py
twitter_openapi_python_generated/models/timestamp.py
twitter_openapi_python_generated/models/tombstone_entity.py
twitter_openapi_python_generated/models/tombstone_info.py
twitter_openapi_python_generated/models/tombstone_ref.py
twitter_openapi_python_generated/models/tombstone_rich_text.py
twitter_openapi_python_generated/models/topic_context.py
twitter_openapi_python_generated/models/tracing.py
twitter_openapi_python_generated/models/trend_results.py
Expand Down
7 changes: 6 additions & 1 deletion twitter_openapi_python_generated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Twitter OpenAPI(Swagger) specification
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 0.0.1
- Package version: 0.0.28
- Package version: 0.0.29
- Generator version: 7.10.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

Expand Down Expand Up @@ -453,11 +453,16 @@ Class | Method | HTTP request | Description
- [TimelineTimelineCursor](docs/TimelineTimelineCursor.md)
- [TimelineTimelineItem](docs/TimelineTimelineItem.md)
- [TimelineTimelineModule](docs/TimelineTimelineModule.md)
- [TimelineTombstone](docs/TimelineTombstone.md)
- [TimelineTopicContext](docs/TimelineTopicContext.md)
- [TimelineTweet](docs/TimelineTweet.md)
- [TimelineUser](docs/TimelineUser.md)
- [TimelineV2](docs/TimelineV2.md)
- [Timestamp](docs/Timestamp.md)
- [TombstoneEntity](docs/TombstoneEntity.md)
- [TombstoneInfo](docs/TombstoneInfo.md)
- [TombstoneRef](docs/TombstoneRef.md)
- [TombstoneRichText](docs/TombstoneRichText.md)
- [TopicContext](docs/TopicContext.md)
- [Tracing](docs/Tracing.md)
- [TrendResults](docs/TrendResults.md)
Expand Down
2 changes: 2 additions & 0 deletions twitter_openapi_python_generated/docs/ContentItemType.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

* `TIMELINECOMMUNITY` (value: `'TimelineCommunity'`)

* `TIMELINETOMBSTONE` (value: `'TimelineTombstone'`)

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


2 changes: 1 addition & 1 deletion twitter_openapi_python_generated/docs/ContentUnion.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**typename** | [**TypeName**](TypeName.md) | |
**client_event_info** | **Dict[str, object]** | |
**client_event_info** | [**ClientEventInfo**](ClientEventInfo.md) | |
**entry_type** | [**ContentEntryType**](ContentEntryType.md) | |
**feedback_info** | [**FeedbackInfo**](FeedbackInfo.md) | | [optional]
**item_content** | [**ItemContentUnion**](ItemContentUnion.md) | |
Expand Down
1 change: 1 addition & 0 deletions twitter_openapi_python_generated/docs/FeedbackInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**client_event_info** | [**ClientEventInfo**](ClientEventInfo.md) | | [optional]
**feedback_keys** | **List[str]** | | [optional]

## Example
Expand Down
2 changes: 2 additions & 0 deletions twitter_openapi_python_generated/docs/ItemContentUnion.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Name | Type | Description | Notes
**value** | **str** | |
**user_display_type** | **str** | |
**user_results** | [**UserResults**](UserResults.md) | |
**tombstone_display_type** | **str** | | [optional]
**tombstone_info** | [**TombstoneInfo**](TombstoneInfo.md) | | [optional]

## Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**typename** | [**TypeName**](TypeName.md) | |
**client_event_info** | **Dict[str, object]** | |
**client_event_info** | [**ClientEventInfo**](ClientEventInfo.md) | |
**display_type** | [**DisplayType**](DisplayType.md) | |
**entry_type** | [**ContentEntryType**](ContentEntryType.md) | |
**feedback_info** | [**FeedbackInfo**](FeedbackInfo.md) | | [optional]
Expand Down
32 changes: 32 additions & 0 deletions twitter_openapi_python_generated/docs/TimelineTombstone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# TimelineTombstone


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**typename** | [**TypeName**](TypeName.md) | | [optional]
**item_type** | [**ContentItemType**](ContentItemType.md) | | [optional]
**tombstone_display_type** | **str** | | [optional]
**tombstone_info** | [**TombstoneInfo**](TombstoneInfo.md) | | [optional]

## Example

```python
from twitter_openapi_python_generated.models.timeline_tombstone import TimelineTombstone

# TODO update the JSON string below
json = "{}"
# create an instance of TimelineTombstone from a JSON string
timeline_tombstone_instance = TimelineTombstone.from_json(json)
# print the JSON string representation of the object
print(TimelineTombstone.to_json())

# convert the object into a dict
timeline_tombstone_dict = timeline_tombstone_instance.to_dict()
# create an instance of TimelineTombstone from a dict
timeline_tombstone_from_dict = TimelineTombstone.from_dict(timeline_tombstone_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


31 changes: 31 additions & 0 deletions twitter_openapi_python_generated/docs/TombstoneEntity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# TombstoneEntity


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**from_index** | **int** | | [optional]
**ref** | [**TombstoneRef**](TombstoneRef.md) | | [optional]
**to_index** | **int** | | [optional]

## Example

```python
from twitter_openapi_python_generated.models.tombstone_entity import TombstoneEntity

# TODO update the JSON string below
json = "{}"
# create an instance of TombstoneEntity from a JSON string
tombstone_entity_instance = TombstoneEntity.from_json(json)
# print the JSON string representation of the object
print(TombstoneEntity.to_json())

# convert the object into a dict
tombstone_entity_dict = tombstone_entity_instance.to_dict()
# create an instance of TombstoneEntity from a dict
tombstone_entity_from_dict = TombstoneEntity.from_dict(tombstone_entity_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


30 changes: 30 additions & 0 deletions twitter_openapi_python_generated/docs/TombstoneInfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# TombstoneInfo


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**rich_text** | [**TombstoneRichText**](TombstoneRichText.md) | | [optional]
**text** | **str** | | [optional]

## Example

```python
from twitter_openapi_python_generated.models.tombstone_info import TombstoneInfo

# TODO update the JSON string below
json = "{}"
# create an instance of TombstoneInfo from a JSON string
tombstone_info_instance = TombstoneInfo.from_json(json)
# print the JSON string representation of the object
print(TombstoneInfo.to_json())

# convert the object into a dict
tombstone_info_dict = tombstone_info_instance.to_dict()
# create an instance of TombstoneInfo from a dict
tombstone_info_from_dict = TombstoneInfo.from_dict(tombstone_info_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


31 changes: 31 additions & 0 deletions twitter_openapi_python_generated/docs/TombstoneRef.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# TombstoneRef


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **str** | | [optional]
**url** | **str** | | [optional]
**url_type** | **str** | | [optional]

## Example

```python
from twitter_openapi_python_generated.models.tombstone_ref import TombstoneRef

# TODO update the JSON string below
json = "{}"
# create an instance of TombstoneRef from a JSON string
tombstone_ref_instance = TombstoneRef.from_json(json)
# print the JSON string representation of the object
print(TombstoneRef.to_json())

# convert the object into a dict
tombstone_ref_dict = tombstone_ref_instance.to_dict()
# create an instance of TombstoneRef from a dict
tombstone_ref_from_dict = TombstoneRef.from_dict(tombstone_ref_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


31 changes: 31 additions & 0 deletions twitter_openapi_python_generated/docs/TombstoneRichText.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# TombstoneRichText


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**entities** | [**List[TombstoneEntity]**](TombstoneEntity.md) | | [optional]
**rtl** | **bool** | | [optional]
**text** | **str** | | [optional]

## Example

```python
from twitter_openapi_python_generated.models.tombstone_rich_text import TombstoneRichText

# TODO update the JSON string below
json = "{}"
# create an instance of TombstoneRichText from a JSON string
tombstone_rich_text_instance = TombstoneRichText.from_json(json)
# print the JSON string representation of the object
print(TombstoneRichText.to_json())

# convert the object into a dict
tombstone_rich_text_dict = tombstone_rich_text_instance.to_dict()
# create an instance of TombstoneRichText from a dict
tombstone_rich_text_from_dict = TombstoneRichText.from_dict(tombstone_rich_text_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


1 change: 1 addition & 0 deletions twitter_openapi_python_generated/docs/Tweet.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Name | Type | Description | Notes
**core** | [**UserResultCore**](UserResultCore.md) | | [optional]
**edit_control** | [**TweetEditControl**](TweetEditControl.md) | | [optional]
**edit_prespective** | [**TweetEditPrespective**](TweetEditPrespective.md) | | [optional]
**grok_analysis_button** | **bool** | | [optional]
**grok_analysis_followups** | **List[str]** | | [optional]
**grok_share_attachment** | [**GrokShareAttachment**](GrokShareAttachment.md) | | [optional]
**has_birdwatch_notes** | **bool** | | [optional]
Expand Down
Loading