{"id":5221,"date":"2019-11-25T18:58:37","date_gmt":"2019-11-25T18:58:37","guid":{"rendered":"https:\/\/holypython.com\/?p=5221"},"modified":"2021-03-28T13:20:13","modified_gmt":"2021-03-28T13:20:13","slug":"api-4-name-generator","status":"publish","type":"post","link":"https:\/\/holypython.com\/api-4-name-generator\/","title":{"rendered":"Name Generator API"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"5221\" class=\"elementor elementor-5221\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-53b32a8 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"53b32a8\" data-element_type=\"section\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-cfc2f91\" data-id=\"cfc2f91\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2d2899d elementor-widget elementor-widget-heading\" data-id=\"2d2899d\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\"><b>Name Generator<\/b><\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-eeb1e41 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"eeb1e41\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b341562\" data-id=\"b341562\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-38e579d elementor-widget elementor-widget-text-editor\" data-id=\"38e579d\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Uinames is a great API to generate names. You can make useful filters such as gender and country as well.<\/p><p>Here is a simply code that uses <b>requests<\/b>, <b>json<\/b> and <b>webbrowser <\/b>libraries harmoniously.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6a7b41c elementor-widget elementor-widget-html\" data-id=\"6a7b41c\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre rel=\"PYTHON\"><code>import webbrowser\r\nimport requests\r\nimport json\r\n\r\nparams = {\"amount\": 500, \"region\": \"united states\", \"gender\": \"female\"}\r\nf = r'https:\/\/uinames.com\/api\/?'\r\ndata = requests.get(f, params = params)\r\n\r\na = data.text\r\na = json.loads(a)\r\n\r\nprint(a)<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ce79508 elementor-widget elementor-widget-text-editor\" data-id=\"ce79508\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>If you need a refresher on user defined functions lesson in Python here is a link to our <a href=\"https:\/\/holypython.com\/beginner-python-lessons\/lesson-16-defining-functions\/\">Defining Functions Lesson<\/a>.<\/p><p><b>Source of API:<\/b>\u00a0<a href=\"https:\/\/uinames.com\/api\/\" target=\"_blank\" rel=\"noopener\">Uinames.com\/api<\/a><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Name Generator Uinames is a great API to generate names. You can make useful filters such as gender and country as well. Here is a simply code that uses requests, json and webbrowser libraries harmoniously. import webbrowser import requests import json params = {&#8220;amount&#8221;: 500, &#8220;region&#8221;: &#8220;united states&#8221;, &#8220;gender&#8221;: &#8220;female&#8221;} f = r&#8217;https:\/\/uinames.com\/api\/?&#8217; data = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5338,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[39],"tags":[],"class_list":["post-5221","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-api"],"acf":[],"_links":{"self":[{"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/posts\/5221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/comments?post=5221"}],"version-history":[{"count":0,"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/posts\/5221\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/media\/5338"}],"wp:attachment":[{"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/media?parent=5221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/categories?post=5221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/tags?post=5221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}