{"id":951,"date":"2021-09-05T00:47:47","date_gmt":"2021-09-05T07:47:47","guid":{"rendered":"https:\/\/gantovnik.com\/bio-tips\/?p=951"},"modified":"2021-09-20T02:36:32","modified_gmt":"2021-09-20T09:36:32","slug":"172-get-book-meta-from-isbn-in-python","status":"publish","type":"post","link":"https:\/\/gantovnik.com\/bio-tips\/2021\/09\/172-get-book-meta-from-isbn-in-python\/","title":{"rendered":"#172 Get book info from ISBN"},"content":{"rendered":"<p>#172 Get book info from ISBN<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport sys\r\nfrom isbntools.app import *\r\nmeta_dict=meta(&quot;156032712X&quot;)\r\ntitle=meta_dict&#x5B;&quot;Title&quot;]\r\ntitle=title.replace(&quot; &quot;,&quot;.&quot;)\r\nauthor=meta_dict&#x5B;&quot;Authors&quot;]&#x5B;0]\r\nauthor=author.replace(&quot; &quot;,&quot;.&quot;)\r\nyear=meta_dict&#x5B;&quot;Year&quot;]\r\nisbn=meta_dict&#x5B;&quot;ISBN-13&quot;]\r\nfilename = title + &quot;.&quot; + author + &quot;.&quot; + year + &quot;.&quot; + isbn + &quot;.pdf&quot;\r\nprint(filename)\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#172 Get book info from ISBN import sys from isbntools.app import * meta_dict=meta(&quot;156032712X&quot;) title=meta_dict&#x5B;&quot;Title&quot;] title=title.replace(&quot; &quot;,&quot;.&quot;) author=meta_dict&#x5B;&quot;Authors&quot;]&#x5B;0] author=author.replace(&quot; &quot;,&quot;.&quot;) year=meta_dict&#x5B;&quot;Year&quot;] isbn=meta_dict&#x5B;&quot;ISBN-13&quot;] filename = title + &quot;.&quot; + author + &quot;.&quot; + year + &quot;.&quot; + isbn + &quot;.pdf&quot; print(filename) }<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_lmt_disableupdate":"yes","_lmt_disable":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-951","post","type-post","status-publish","format-standard","hentry","category-python"],"modified_by":"gantovnik","jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8bH0k-fl","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":630,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/09\/98-making-a-movie-of-a-plot\/","url_meta":{"origin":951,"position":0},"title":"#98 Making a movie of a plot","author":"gantovnik","date":"2020-09-17","format":false,"excerpt":"#98 Making a movie of a plot Consider Gaussian bell function. [code language=\"python\"] import matplotlib.pyplot as plt import numpy as np import os os.chdir(r'D:\\projects\\wordpress\\ex99') os.getcwd() def f(x, m, s): return (1.0\/(np.sqrt(2*np.pi)*s))*np.exp(-0.5*((x-m)\/s)**2) m = 0; s_start = 2; s_stop = 0.2 s_values = np.linspace(s_start, s_stop, 50) #number of png files x\u2026","rel":"","context":"In &quot;python&quot;","block_context":{"text":"python","link":"https:\/\/gantovnik.com\/bio-tips\/category\/python\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2140,"url":"https:\/\/gantovnik.com\/bio-tips\/2024\/02\/417-polar-plot-using-sympy-plotting-functions-in-python\/","url_meta":{"origin":951,"position":1},"title":"#417 Polar plot using SymPy plotting functions in python","author":"gantovnik","date":"2024-02-21","format":false,"excerpt":"[code language=\"python\"] import matplotlib.pyplot as plt from sympy import symbols, sin, cos, pi, latex from spb import plot_polar x = symbols(\"x\") expr = sin(2 * x) * cos(5 * x) + pi \/ 2 plot_polar(expr, (x, 0, 2 * pi), polar_axis=True, ylim=(0, 3), title=\"$%s$\" % latex(expr)) plt.savefig(\"ex417.png\", dpi=100) plt.show() [\/code]","rel":"","context":"In &quot;matplotlib&quot;","block_context":{"text":"matplotlib","link":"https:\/\/gantovnik.com\/bio-tips\/category\/matplotlib\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/02\/ex417.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/02\/ex417.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/02\/ex417.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/02\/ex417.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":9440,"url":"https:\/\/gantovnik.com\/bio-tips\/2025\/04\/459-python-script-to-group-consecutive-numbers-into-ranges-like-in-msc-patran\/","url_meta":{"origin":951,"position":2},"title":"#459 Python Script to Group Consecutive Numbers into Ranges Like in MSC Patran","author":"gantovnik","date":"2025-04-20","format":false,"excerpt":"This Python script reads a text file containing a list of numbers (such as node or element IDs), sorts them, removes duplicates, and groups consecutive numbers into compact ranges - just like MSC Patran's range format. It's a handy tool for preprocessing or organizing large ID lists efficiently. def read_numbers(filename):\u2026","rel":"","context":"In &quot;patran&quot;","block_context":{"text":"patran","link":"https:\/\/gantovnik.com\/bio-tips\/category\/patran\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6737,"url":"https:\/\/gantovnik.com\/bio-tips\/2024\/12\/455-creating-a-simple-table-with-python\/","url_meta":{"origin":951,"position":3},"title":"#455 Creating a Simple Table with Python","author":"gantovnik","date":"2024-12-17","format":false,"excerpt":"from rich.table import Table from rich.console import Console console=Console() table = Table(title=\"User Data\") table.add_column(\"ID\",justify=\"right\",style=\"cyan\",no_wrap=True) table.add_column(\"Name\",style=\"magenta\") table.add_column(\"Age\",justify=\"right\",style=\"green\") table.add_row(\"1\",\"Alice\",\"28\") table.add_row(\"2\",\"Bob\",\"32\") table.add_row(\"3\",\"Charlie\",\"22\") console.print(table) Output: User Data \u250c\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2510 \u2502 ID \u2502 Name \u2502 Age \u2502 \u251c\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524 \u2502 1 \u2502 Alice \u2502 28 \u2502 \u2502 2 \u2502 Bob \u2502 32 \u2502 \u2502 3 \u2502 Charlie\u2026","rel":"","context":"In &quot;python&quot;","block_context":{"text":"python","link":"https:\/\/gantovnik.com\/bio-tips\/category\/python\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/12\/ex455.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1109,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/11\/193-animation-using-python\/","url_meta":{"origin":951,"position":4},"title":"#193 Animation using python","author":"gantovnik","date":"2021-11-19","format":false,"excerpt":"[code language=\"python\"] # create an animation import numpy as np import matplotlib.pyplot as plt import matplotlib. Animation as manimation n = 1000 x = np.linspace(0, 6*np.pi, n) y = np.sin(x) # Define the meta data for the movie FFMpegWriter = manimation.writers[\"ffmpeg\"] metadata = dict(title=\"Movie Test\", artist=\"Matplotlib\", comment=\"a red circle following\u2026","rel":"","context":"In &quot;python&quot;","block_context":{"text":"python","link":"https:\/\/gantovnik.com\/bio-tips\/category\/python\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2021\/11\/ex193.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2021\/11\/ex193.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2021\/11\/ex193.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2021\/11\/ex193.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":2219,"url":"https:\/\/gantovnik.com\/bio-tips\/2024\/06\/431-hypermesh-python-script-to-create-nodes-using-coordinates-from-csv-file\/","url_meta":{"origin":951,"position":5},"title":"#431 HyperMesh python script to create nodes using coordinates from csv file","author":"gantovnik","date":"2024-06-24","format":false,"excerpt":"Finally, I read how to write a script for HyperMesh in python. In this example, the script reads the coordinates of points from a cvs file. [code language=\"python\"] import os import hm import hm.entities as e from hwx import gui import csv model=hm.Model() os.chdir(r\"D:\\projects\\wordpress\\ex431\") with open('ex431_coordinates.csv', mode ='r') as file:\u2026","rel":"","context":"In &quot;HyperMesh&quot;","block_context":{"text":"HyperMesh","link":"https:\/\/gantovnik.com\/bio-tips\/category\/hypermesh\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/06\/ex431.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/951","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/comments?post=951"}],"version-history":[{"count":0,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/951\/revisions"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}